diff options
author | Gerrit Pape <pape@smarden.org> | 2018-09-07 10:34:14 +0200 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2020-03-28 21:42:55 +0000 |
commit | d754d32592fa1c6359b37d101485ced1ff7cdf79 (patch) | |
tree | 12546b42e71368527f495b935a94b77c92c1b536 | |
parent | 9adc45f99d817c34e9ac95d240f54dd2bb4970c2 (diff) | |
download | klibc-d754d32592fa1c6359b37d101485ced1ff7cdf79.tar.gz |
[klibc] dash: main: Print \n upon EOF (CTRL-D) when run interactively
[ dash commit 413c6dcc3ca3891825ae8239251140882d7c6c6c ]
Exiting dash via a ^D instead of with "exit" causes dash to forget to
print a newline.
sh-3.1$ sh
sh-3.1$ ^D
sh-3.1$ dash
$ sh-3.1$
It is more neat and tidy to send a newline similarly to what bash does,
so it doesn't make the next prompt of the parent shell look ugly.
Suggested by jidanni.
Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
[reworded the patch description]
Signed-off-by: Andrej Shadura <andrew.shadura@collabora.co.uk>
Bug-Debian: http://bugs.debian.org/476422
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | usr/dash/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr/dash/main.c b/usr/dash/main.c index e8e42565e9e22..6d53e0090d921 100644 --- a/usr/dash/main.c +++ b/usr/dash/main.c @@ -221,8 +221,15 @@ cmdloop(int top) if (!top || numeof >= 50) break; if (!stoppedjobs()) { - if (!Iflag) + if (!Iflag) { + if (iflag) { + out2c('\n'); +#ifdef FLUSHERR + flushout(out2); +#endif + } break; + } out2str("\nUse \"exit\" to leave shell.\n"); } numeof++; |