Skip to content

Commit d0facc3

Browse files
committed
Do not clear the existing plot when receiving SIGINT
1 parent 054a04f commit d0facc3

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

example/animation.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ def out.tty?; true; end
2525
$stdout.print "\e[0J"
2626
$stdout.flush
2727

28-
n = lines.count
29-
$stdout.print "\e[#{n}F"
30-
shift = (shift + M) % N
31-
3228
sleep 0.2
29+
30+
if continue
31+
n = lines.count
32+
$stdout.print "\e[#{n}F"
33+
shift = (shift + M) % N
34+
end
3335
end
3436

3537
$stdout.print "\e[0J"

0 commit comments

Comments
 (0)