Catch keyboard interrupt and gracefully abort
This commit is contained in:
parent
e0a2993c36
commit
baaf1994e3
1 changed files with 12 additions and 7 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue