Merge pull request #115 from cdfrey/minor-backspace-fix

Handle KEY_BACKSPACE in tui.c for tuidemo
This commit is contained in:
William McBrine
2021-06-29 20:38:13 -04:00
committed by GitHub

View File

@@ -689,7 +689,11 @@ int weditstr(WINDOW *win, char *buf, int field)
break;
default:
if (c == erasechar()) /* backspace, ^H */
/* check KEY_BACKSPACE manually, because erasechar() can only
* return char, and KEY_BACKSPACE is an int, so on systems
* that truly return KEY_BACKSPACE from wgetch(), we'll never
* catch it with erasechar() */
if (c == erasechar() || c == KEY_BACKSPACE)
{
if (bp > buf)
{