]> Sergey Matveev's repositories - nnn.git/commitdiff
Handle DEL in rename prompt (Mac)
authorArun Prakash Jana <engineerarun@gmail.com>
Fri, 23 Nov 2018 21:36:01 +0000 (03:06 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Fri, 23 Nov 2018 21:36:01 +0000 (03:06 +0530)
src/nnn.c
src/nnn.h

index 1e506bd036a314055e48173576d0b51fed0e15df..a20dfe797ea2d143444b4aeb22abf86f888fc807 100644 (file)
--- 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);
index 9ddccb051d97eb50357a3dff6bfc2af9212af758..e7a4d245ce46c6fbcae807e2053db2049094f631 100644 (file)
--- 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,      "",     "" },