diff --git a/compat/terminal.c b/compat/terminal.c index 025960d80e..4081eafa1b 100644 --- a/compat/terminal.c +++ b/compat/terminal.c @@ -97,20 +97,16 @@ static int disable_echo(void) static char *xterm_prompt(const char *prompt, int echo) { const char *read_input[] = { - "sh", "-c", - "cat >/dev/tty && read -r line /dev/tty && read -r line /dev/tty && read -r -s line /dev/tty", NULL }; - const char *echo_off[] = { "sh", "-c", "stty -echo /dev/tty", NULL }; struct child_process child = CHILD_PROCESS_INIT; static struct strbuf buffer = STRBUF_INIT; int prompt_len = strlen(prompt), len = -1, code; - if (!echo && run_command_v_opt(echo_off, 0)) - warning("Could not disable echo on xterm"); - child.argv = read_input; child.in = -1; child.out = -1; @@ -143,12 +139,6 @@ ret: if (!code) finish_command(&child); - if (!echo) { - if (run_command_v_opt(echo_on, 0)) - warning("Could not enable echo on xterm"); - run_command_v_opt(new_line, 0); - } - return len < 0 ? NULL : buffer.buf; }