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() init_global_vars()
if __name__ == '__main__': if __name__ == '__main__':
# Show menu
try: try:
# Show menu
state = State() state = State()
menu_diags(state, sys.argv) menu_diags(state, sys.argv)
except KeyboardInterrupt:
# Done print_standard(' ')
#print_standard('\nDone.') print_warning('Aborted')
#pause("Press Enter to exit...") print_standard(' ')
exit_script() sleep(1)
pause('Press Enter to exit...')
except SystemExit: except SystemExit:
tmux_kill_all_panes() # Normal exit
pass pass
except: except:
tmux_kill_all_panes() tmux_kill_all_panes()
major_exception() major_exception()
# Done
tmux_kill_all_panes()
exit_script()
# vim: sts=2 sw=2 ts=2 # vim: sts=2 sw=2 ts=2