Skip to content

Commit

Permalink
Prevent cursor flickering
Browse files Browse the repository at this point in the history
  • Loading branch information
ima1zumi committed Nov 30, 2024
1 parent 4217a46 commit 5629203
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/irb/easter-egg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def render_frame(i)
end
end
buff[0, 20] = "\e[0mPress Ctrl+C to stop\e[31m\e[1m"
print "\e[?25l" # hide cursor
print "\e[H" + buff
sleep 0.05
break if interrupted
Expand All @@ -142,6 +143,7 @@ def render_frame(i)
end
end
ensure
print "\e[?25h" # show cursor
print "\e[0m\e[?1049l"
end
end
Expand Down

0 comments on commit 5629203

Please sign in to comment.