Handle DEL in rename prompt (Mac)

This commit is contained in:
Arun Prakash Jana 2018-11-24 03:06:01 +05:30
parent ab4c6ff363
commit 075c0cb935
No known key found for this signature in database
GPG Key ID: A75979F35C080412
2 changed files with 2 additions and 1 deletions

View File

@ -1269,6 +1269,7 @@ static char *xreadline(char *fname, char *prompt)
case '\n': // fallthrough
case '\r':
goto END;
case 127: /* Handle DEL */ // fallthrough
case '\b': /* some old curses (e.g. rhel25) still send '\b' for backspace */
if (pos > 0) {
memmove(buf + pos - 1, buf + pos, (len - pos) << 2);

View File

@ -109,7 +109,7 @@ static struct assoc assocs[] = {
static struct key bindings[] = {
/* Back */
{ KEY_BACKSPACE, SEL_BACK, "", "" },
{ 8 /* BS */, SEL_BACK, "", "" },
{ '\b' /* BS */, SEL_BACK, "", "" },
{ 127 /* DEL */, SEL_BACK, "", "" },
{ KEY_LEFT, SEL_BACK, "", "" },
{ 'h', SEL_BACK, "", "" },