Catch keyboard interrupt and gracefully abort

This commit is contained in:
2Shirt 2018-12-16 22:44:46 -07:00
parent e0a2993c36
commit baaf1994e3
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -13,20 +13,25 @@ from functions.tmux import *
init_global_vars()
if __name__ == '__main__':
# Show menu
try:
# Show menu
state = State()
menu_diags(state, sys.argv)
# Done
#print_standard('\nDone.')
#pause("Press Enter to exit...")
exit_script()
except KeyboardInterrupt:
print_standard(' ')
print_warning('Aborted')
print_standard(' ')
sleep(1)
pause('Press Enter to exit...')
except SystemExit:
tmux_kill_all_panes()
# Normal exit
pass
except:
tmux_kill_all_panes()
major_exception()
# Done
tmux_kill_all_panes()
exit_script()
# vim: sts=2 sw=2 ts=2