Re: [misc] calcurse 7b81e69 and OpenBSD patches - wgetch and TERM pccon0

On Fri, 08 Feb 2019 at 15:14:21, Mikolaj Kucharski wrote:
> [...]
> 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.
> 
> Index: src/getstring.c
> --- src/getstring.c.orig
> +++ src/getstring.c
> @@ -191,7 +191,8 @@ enum getstr getstring(WINDOW * win, char *str, int l, 
>                 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 */
> [...]

Will commit to master. Thanks!

Lukas

Links