From 778b3da79a01eec25dfdc69279aa2a7c253d94d3 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 6 Jun 2020 13:34:54 +0200 Subject: [PATCH] manual page: correct conditions under which shell is interactive Only standard error needs to be on a terminal for a shell to be interactive on init, not all output. See sh_main() in src/cmd/ksh93/sh/main.c, under "/* decide whether shell is interactive */". Also, tcgetattr is not a syscall, so its manual page is tcgetattr(3), not tcgetattr(2). (cherry picked from commit 97f8bdb08650fd63f8e125257a86f5e6035fbdfa) --- src/cmd/ksh93/sh.1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/ksh93/sh.1 b/src/cmd/ksh93/sh.1 index 211deda91..5f425c172 100644 --- a/src/cmd/ksh93/sh.1 +++ b/src/cmd/ksh93/sh.1 @@ -7928,8 +7928,8 @@ file descriptor 2. If the .B \-i option is present or -if the shell input and output are attached to a terminal (as told by -.IR tcgetattr (2)), +if the shell's standard input and standard error are attached to a terminal (as told by +.IR tcgetattr (3)), then this shell is .IR interactive . In this case \s-1TERM\s+1 is ignored (so that \f3kill 0\fP