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 <mikolaj@kucharski.name>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer 2019-02-10 21:40:11 +01:00
parent 0bbe802002
commit 6cd67311e3

View File

@ -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 */