You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently lolcat -a breaks horribly in kitty because of how the DECSC and DECRC escape sequences are used, see kovidgoyal/kitty#2813.
lolcat currently saves the cursor position only once with DECSC and then restores it many times with DECRC. Since the standard seems to leave some room for interpretation, kitty expects every DECRC to have a corresponding DECSC some time earlier.
I wrote two alternative patches that fix the issue. I'm very sure, that the second patch will not break anything for other terminals. These are the very first lines of Ruby I wrote, so keep that in mind.
--- a/lib/lolcat/lol.rb+++ b/lib/lolcat/lol.rb@@ -100,10 +100,14 @@ module Lol
def self.println_ani(str, opts={}, chomped)
return if str.empty?
- print "\e7"
@real_os = @os
(1..opts[:duration]).each do |i|
- print "\e8"+ if i > 1+ print "\e8"+ end+ if i < opts[:duration]+ print "\e7"+ end
@os += opts[:spread]
println_plain(str, opts, chomped)
str.gsub!(/\e\[[0-?]*[@JKPX]/, "")
The first patch looks nicer but resets the cursor position after the line is finished printing, which may or may not be a problem. It also saves and restores the cursor unnecessarily multiple times.
The second patch fixes this but looks overly complicated. There is probably a nicer way to do this.
The text was updated successfully, but these errors were encountered:
Currently
lolcat -a
breaks horribly in kitty because of how the DECSC and DECRC escape sequences are used, see kovidgoyal/kitty#2813.lolcat currently saves the cursor position only once with DECSC and then restores it many times with DECRC. Since the standard seems to leave some room for interpretation, kitty expects every DECRC to have a corresponding DECSC some time earlier.
I wrote two alternative patches that fix the issue. I'm very sure, that the second patch will not break anything for other terminals. These are the very first lines of Ruby I wrote, so keep that in mind.
The first patch looks nicer but resets the cursor position after the line is finished printing, which may or may not be a problem. It also saves and restores the cursor unnecessarily multiple times.
The second patch fixes this but looks overly complicated. There is probably a nicer way to do this.
The text was updated successfully, but these errors were encountered: