Made gifterm exit silently when a KeyboardInterrupt occurs
This commit is contained in:
parent
cbe9fe37cc
commit
6a1f9902f1
1 changed files with 8 additions and 5 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue