diff options
Diffstat (limited to 'pixelterm')
-rwxr-xr-x | pixelterm/gifterm.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/pixelterm/gifterm.py b/pixelterm/gifterm.py index 67ee99f..85c0428 100755 --- a/pixelterm/gifterm.py +++ b/pixelterm/gifterm.py @@ -43,11 +43,14 @@ def main(): atexit.register(lambda:print(cursor_visible)) signal.signal(signal.SIGTERM, lambda signum, stack_frame: exit(1)) - while True: - for frame in frames: - print(clear_screen, pixelterm.reset_sequence) - print(frame) - time.sleep(img.info['duration']/1000.0) + try: + while True: + for frame in frames: + print(clear_screen, pixelterm.reset_sequence) + print(frame) + time.sleep(img.info['duration']/1000.0) + except KeyboardInterrupt: + pass if __name__ == '__main__': main() |