diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-07 14:03:39 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-07 14:03:39 +0100 |
commit | 05c34b8154b16532a330d5e430491832467f2b6a (patch) | |
tree | 855a52dc479366ca11ba5d3956ff77ca3acdd147 /src/display/client.nim | |
parent | 7c561cbe1c4d53e49be7f76aac758b8048a69f83 (diff) | |
download | chawan-05c34b8154b16532a330d5e430491832467f2b6a.tar.gz |
Catch EOFError in console.readChar
Diffstat (limited to 'src/display/client.nim')
-rw-r--r-- | src/display/client.nim | 5 |
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) |