From 437cec386f19b6f17b2ba3fa455838a99d9643bb Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 21 Mar 2020 12:34:15 +0000 Subject: [PATCH] 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 --- text-utils/more.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 *); -- 2.47.2