summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-04-14 23:19:33 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-04-14 23:19:55 +0900
commit2d68cb8639a78ec6b7e88dd71e2ce1a638e5f8ea (patch)
tree8daa5da3c39b50b998f4f6b69ce48554471a1460 /src
parent3a9d1df0264226f953698c03914575d5f6b1d974 (diff)
Fix #185 - Terminate on RuneError
Diffstat (limited to 'src')
-rw-r--r--src/curses/curses.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/curses/curses.go b/src/curses/curses.go
index d6aafd71..f3ad1437 100644
--- a/src/curses/curses.go
+++ b/src/curses/curses.go
@@ -420,6 +420,9 @@ func GetChar() Event {
return Event{int(_buf[0]), 0, nil}
}
r, rsz := utf8.DecodeRune(_buf)
+ if r == utf8.RuneError {
+ return Event{ESC, 0, nil}
+ }
sz = rsz
return Event{Rune, r, nil}
}