about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-07 14:03:39 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-07 14:03:39 +0100
commit05c34b8154b16532a330d5e430491832467f2b6a (patch)
tree855a52dc479366ca11ba5d3956ff77ca3acdd147 /src/display/client.nim
parent7c561cbe1c4d53e49be7f76aac758b8048a69f83 (diff)
downloadchawan-05c34b8154b16532a330d5e430491832467f2b6a.tar.gz
Catch EOFError in console.readChar
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index 8c591600..e696457c 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -70,7 +70,10 @@ type
 
 proc readChar(console: Console): char =
   if console.ibuf == "":
-    return console.tty.readChar()
+    try:
+      return console.tty.readChar()
+    except EOFError:
+      quit(1)
   result = console.ibuf[0]
   console.ibuf = console.ibuf.substr(1)