From 6cd67311e30c2dc3c138f339b536679ad1a8d5f4 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Sun, 10 Feb 2019 21:40:11 +0100 Subject: Check for KEY_ENTER in getstring() In some cases (e.g., TERM=pccon0) wgetch(3) can return KEY_ENTER instead of '\n' when the return key is pressed, causing getstring() to fail. Suggested-by: Mikolaj Kucharski Signed-off-by: Lukas Fleischer --- src/getstring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/getstring.c b/src/getstring.c index 6546565..186598d 100644 --- a/src/getstring.c +++ b/src/getstring.c @@ -191,7 +191,8 @@ enum getstr getstring(WINDOW * win, char *str, int l, int x, int y) getstr_print(win, x, y, &st); wins_doupdate(); - if ((ch = wgetch(win)) == '\n') + ch = wgetch(win); + if ((ch == '\n') || (ch == KEY_ENTER)) break; switch (ch) { case KEY_BACKSPACE: /* delete one character */ -- cgit v1.2.3-70-g09d2