mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Exit prompt on ^D at empty prompt
This commit is contained in:
parent
812368cce6
commit
e3d80da2ad
|
@ -2412,8 +2412,12 @@ static char *xreadline(const char *prefill, const char *prompt)
|
||||||
case CONTROL('D'):
|
case CONTROL('D'):
|
||||||
if (pos < len)
|
if (pos < len)
|
||||||
++pos;
|
++pos;
|
||||||
else
|
else if (!(pos || len)) { /* Exit on ^D at empty prompt */
|
||||||
continue; // fallthrough
|
len = 0;
|
||||||
|
goto END;
|
||||||
|
} else
|
||||||
|
continue;
|
||||||
|
// fallthrough
|
||||||
case 127: // fallthrough
|
case 127: // fallthrough
|
||||||
case '\b': /* rhel25 sends '\b' for backspace */
|
case '\b': /* rhel25 sends '\b' for backspace */
|
||||||
if (pos > 0) {
|
if (pos > 0) {
|
||||||
|
|
Loading…
Reference in a new issue