Catch ctrl+c, clean shutdown

This commit is contained in:
Tanner committed 2026-11-14 17:12:36 +00:00
1 parent b75ad65de8
commit cee0aa0bbd
2 files changed
+70

No files matched your search

+2
View File
@@ -218,6 +218,8 @@ def main(global_state=None, *, server=None, port=None, username=None,
print('Connection ended.', flush=True)
except KeyboardInterrupt:
shutdown_requested = True
if global_state is not None:
global_state.running = False
print('Disconnecting...', flush=True)
connection.disconnect()
finally: