From: Arun Prakash Jana Date: Mon, 27 Jan 2020 14:16:10 +0000 (+0530) Subject: Exit prompt on ^D at empty prompt X-Git-Tag: v3.0~37 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=e3d80da2ad6662e1d0bee6ebed5d7ac2bf104bc5;p=nnn.git Exit prompt on ^D at empty prompt --- diff --git a/src/nnn.c b/src/nnn.c index 5b1c7a8c..6a35f113 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -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) {