From 4b89d512b1215e7b9d619af03496540d30cbbd1a Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 25 Nov 2016 03:41:03 +0100 Subject: ash,hush: make ^C in interactive mode visually much closer to bash behavior Signed-off-by: Denys Vlasenko --- libbb/lineedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbb') diff --git a/libbb/lineedit.c b/libbb/lineedit.c index ac049f57d..4d7828cfa 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c @@ -2251,6 +2251,7 @@ static int32_t reverse_i_search(void) * Returns: * -1 on read errors or EOF, or on bare Ctrl-D, * 0 on ctrl-C (the line entered is still returned in 'command'), + * (in both cases the cursor remains on the input line, '\n' is not printed) * >0 length of input string, including terminating '\n' */ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *command, int maxsize, int timeout) @@ -2686,7 +2687,6 @@ int FAST_FUNC read_line_input(line_input_t *st, const char *prompt, char *comman && ic_raw == initial_settings.c_cc[VINTR] ) { /* Ctrl-C (usually) - stop gathering input */ - goto_new_line(); command_len = 0; break_out = -1; /* "do not append '\n'" */ break; -- cgit v1.2.3