diff options
author | Arun Prakash Jana <engineerarun@gmail.com> | 2020-01-27 19:46:10 +0530 |
---|---|---|
committer | Arun Prakash Jana <engineerarun@gmail.com> | 2020-01-27 19:46:10 +0530 |
commit | e3d80da2ad6662e1d0bee6ebed5d7ac2bf104bc5 (patch) | |
tree | 32088f26a52c38907cb81a72deb4a0996252914a | |
parent | 812368cce65d7a664379f8ca7403372c8ff28101 (diff) | |
download | nnn-e3d80da2ad6662e1d0bee6ebed5d7ac2bf104bc5.tar.gz |
Exit prompt on ^D at empty prompt
-rw-r--r-- | src/nnn.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -2412,8 +2412,12 @@ static char *xreadline(const char *prefill, const char *prompt) case CONTROL('D'): if (pos < len) ++pos; - else - continue; // fallthrough + else if (!(pos || len)) { /* Exit on ^D at empty prompt */ + len = 0; + goto END; + } else + continue; + // fallthrough case 127: // fallthrough case '\b': /* rhel25 sends '\b' for backspace */ if (pos > 0) { |