summaryrefslogtreecommitdiffhomepage
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2016-11-25 03:41:03 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2016-11-25 03:41:03 +0100
commit4b89d512b1215e7b9d619af03496540d30cbbd1a (patch)
tree166830c57d912e78dfac591c4e47a5cd80cb886e /shell/ash.c
parent24860fa09cf954704232406055d7ca291c636eab (diff)
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.c4
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)
reinit_unicode_for_ash();
nr = read_line_input(line_input_state, cmdedit_prompt, buf, IBUFSIZ, timeout);
if (nr == 0) {
- /* Ctrl+C pressed */
+ /* ^C pressed, "convert" to SIGINT */
+ write(STDOUT_FILENO, "^C", 2);
if (trap[SIGINT]) {
buf[0] = '\n';
buf[1] = '\0';
@@ -9877,6 +9878,7 @@ preadfd(void)
return 1;
}
exitstatus = 128 + SIGINT;
+ bb_putchar('\n');
goto retry;
}
if (nr < 0) {