aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-24 03:06:01 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2018-11-24 03:06:01 +0530
commit075c0cb935890a050e1c1497f6ad5fc4fb07c347 (patch)
tree536d8a9911b7b14e2f4f2f4eb7784a18497fce26
parentab4c6ff363b8b8cf6afbab68a697184aca6d0582 (diff)
downloadnnn-075c0cb935890a050e1c1497f6ad5fc4fb07c347.tar.gz
Handle DEL in rename prompt (Mac)
-rw-r--r--src/nnn.c1
-rw-r--r--src/nnn.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 1e506bd..a20dfe7 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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);
diff --git a/src/nnn.h b/src/nnn.h
index 9ddccb0..e7a4d24 100644
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -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, "", "" },