From: Sami Kerola Date: Sat, 21 Mar 2020 12:34:15 +0000 (+0000) Subject: more: do not reset parent process terminal in execute() X-Git-Tag: v2.36-rc1~147^2~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=437cec386f19b6f17b2ba3fa455838a99d9643bb;p=thirdparty%2Futil-linux.git more: do not reset parent process terminal in execute() Only the terminal of the child process, that is the command being executed, needs the reset. Signed-off-by: Sami Kerola --- diff --git a/text-utils/more.c b/text-utils/more.c index a1b4df7af8..0b3e838288 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -1095,7 +1095,6 @@ static void execute(struct more_control *ctl, char *filename, char *cmd, ...) int argcount; fflush(stdout); - reset_tty(ctl); for (n = 10; (id = fork()) < 0 && n > 0; n--) sleep(5); if (id == 0) { @@ -1104,6 +1103,7 @@ static void execute(struct more_control *ctl, char *filename, char *cmd, ...) close(STDIN_FILENO); open("/dev/tty", 0); } + reset_tty(ctl); va_start(argp, cmd); arg = va_arg(argp, char *);