summaryrefslogtreecommitdiff
path: root/asciifarm/client/start.py
diff options
context:
space:
mode:
Diffstat (limited to 'asciifarm/client/start.py')
-rw-r--r--asciifarm/client/start.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/asciifarm/client/start.py b/asciifarm/client/start.py
index 0a6cfa4..3e24e4a 100644
--- a/asciifarm/client/start.py
+++ b/asciifarm/client/start.py
@@ -23,19 +23,19 @@ def main(name, socketType, address, keybindings, characters, colours=False, logf
print("ERROR: Could not connect to server.\nAre you sure that the server is running and that you're connecting to the right address?", file=sys.stderr)
return
- caught_ctrl_c = False
+ closeMessage = None
def start(stdscr):
display = Display(stdscr, characters, colours)
client = Client(stdscr, display, name, connection, keybindings, logfile)
- nonlocal caught_ctrl_c
try:
client.start()
except KeyboardInterrupt:
- client.keepAlive = False
- caught_ctrl_c = True
+ client.close("^C caught, goodbye")
+ nonlocal closeMessage
+ closeMessage = client.closeMessage
curses.wrapper(start)
- if caught_ctrl_c:
- print('^C caught, goodbye!')
+ if closeMessage:
+ print(closeMessage, file=sys.stderr)