From: Karel Zak Date: Fri, 22 Nov 2019 13:04:21 +0000 (+0100) Subject: scriptlive: keep ECHO flag, improve welcome message X-Git-Tag: v2.35-rc1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a2d27a242bf284286883cdb63ac36b211b91a16;p=thirdparty%2Futil-linux.git scriptlive: keep ECHO flag, improve welcome message Signed-off-by: Karel Zak --- diff --git a/term-utils/scriptlive.c b/term-utils/scriptlive.c index 9b99ccbefc..899871574b 100644 --- a/term-utils/scriptlive.c +++ b/term-utils/scriptlive.c @@ -238,9 +238,6 @@ main(int argc, char *argv[]) argv += optind; idx = 0; - if (!isatty(STDIN_FILENO)) - errx(EXIT_FAILURE, _("stdin is not terminal")); - if (!log_tm && idx < argc) log_tm = argv[idx++]; if (!log_in && !log_io && idx < argc) @@ -278,7 +275,8 @@ main(int argc, char *argv[]) if (shell == NULL) shell = _PATH_BSHELL; - fprintf(stdout, _(">>> scriptlive: Starting your typescript execution by %s.\n"), shell); + fprintf(stdout, _(">>> scriptlive: Starting your typescript execution by %s.\n"), + command ? command : shell); ul_pty_init_debug(0); @@ -291,6 +289,10 @@ main(int argc, char *argv[]) cb->child_sigstop = callback_child_sigstop; cb->mainloop = mainloop_cb; + if (!isatty(STDIN_FILENO)) + /* We keep ECHO flag for compatibility with script(1) */ + ul_pty_keep_slave_echo(ss.pty, 1); + if (ul_pty_setup(ss.pty)) err(EXIT_FAILURE, _("failed to create pseudo-terminal"));