diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-25 03:41:03 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-25 03:41:03 +0100 |
commit | 4b89d512b1215e7b9d619af03496540d30cbbd1a (patch) | |
tree | 166830c57d912e78dfac591c4e47a5cd80cb886e /shell/ash.c | |
parent | 24860fa09cf954704232406055d7ca291c636eab (diff) | |
download | busybox-w32-4b89d512b1215e7b9d619af03496540d30cbbd1a.tar.gz busybox-w32-4b89d512b1215e7b9d619af03496540d30cbbd1a.tar.bz2 busybox-w32-4b89d512b1215e7b9d619af03496540d30cbbd1a.zip |
ash,hush: make ^C in interactive mode visually much closer to bash behavior
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r-- | shell/ash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index 3e5a3b3e9..2bdb4aad7 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -9869,7 +9869,8 @@ preadfd(void) | |||
9869 | reinit_unicode_for_ash(); | 9869 | reinit_unicode_for_ash(); |
9870 | nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout); | 9870 | nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout); |
9871 | if (nr == 0) { | 9871 | if (nr == 0) { |
9872 | /* Ctrl+C pressed */ | 9872 | /* ^C pressed, "convert" to SIGINT */ |
9873 | write(STDOUT_FILENO, "^C", 2); | ||
9873 | if (trap[SIGINT]) { | 9874 | if (trap[SIGINT]) { |
9874 | buf[0] = '\n'; | 9875 | buf[0] = '\n'; |
9875 | buf[1] = '\0'; | 9876 | buf[1] = '\0'; |
@@ -9877,6 +9878,7 @@ preadfd(void) | |||
9877 | return 1; | 9878 | return 1; |
9878 | } | 9879 | } |
9879 | exitstatus = 128 + SIGINT; | 9880 | exitstatus = 128 + SIGINT; |
9881 | bb_putchar('\n'); | ||
9880 | goto retry; | 9882 | goto retry; |
9881 | } | 9883 | } |
9882 | if (nr < 0) { | 9884 | if (nr < 0) { |