diff options
-rw-r--r-- | libbb/lineedit.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 431f1c048..6ecf01765 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -2402,6 +2402,11 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
2402 | | TERMIOS_CLEAR_ISIG /* turn off INTR (ctrl-C), QUIT, SUSP */ | 2402 | | TERMIOS_CLEAR_ISIG /* turn off INTR (ctrl-C), QUIT, SUSP */ |
2403 | ); | 2403 | ); |
2404 | if (n != 0 || (initial_settings.c_lflag & (ECHO|ICANON)) == ICANON) { | 2404 | if (n != 0 || (initial_settings.c_lflag & (ECHO|ICANON)) == ICANON) { |
2405 | #else | ||
2406 | initial_settings.c_cc[VINTR] = CTRL('C'); | ||
2407 | initial_settings.c_cc[VEOF] = CTRL('D'); | ||
2408 | if (!isatty(0) || !isatty(1)) { | ||
2409 | #endif | ||
2405 | /* Happens when e.g. stty -echo was run before. | 2410 | /* Happens when e.g. stty -echo was run before. |
2406 | * But if ICANON is not set, we don't come here. | 2411 | * But if ICANON is not set, we don't come here. |
2407 | * (example: interactive python ^Z-backgrounded, | 2412 | * (example: interactive python ^Z-backgrounded, |
@@ -2416,10 +2421,6 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman | |||
2416 | DEINIT_S(); | 2421 | DEINIT_S(); |
2417 | return len; | 2422 | return len; |
2418 | } | 2423 | } |
2419 | #else | ||
2420 | initial_settings.c_cc[VINTR] = CTRL('C'); | ||
2421 | initial_settings.c_cc[VEOF] = CTRL('D'); | ||
2422 | #endif | ||
2423 | 2424 | ||
2424 | init_unicode(); | 2425 | init_unicode(); |
2425 | 2426 | ||