Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/bin/sh



Module Name:    src
Committed By:   kre
Date:           Sun Jul 19 16:03:58 UTC 2026

Modified Files:
        src/bin/sh: jobs.c sh.1

Log Message:
/bin/sh - minor -i & -m changes

When enabling job control (set -m) at the top level (not in any kind
of subshell) in a non-interactive shell, sh would sometimes send itself
a SIGTTIN (suspending itself) if it was unable to grab the controlling
terminal.   Only interactive shells should be concerned with that,
so an interactive sh placed in the background, trying to manipulate
the controlling tty will simply suspend, until it is resumed in fg.
Scripts shouldn't need to care.

So only do controlling tty manipulation in interactive shells (-i is set).

While here, clean up the manual description of the -i flag, setting it on
the command line does not always make a shell interactive (the shell will
simply clear it if it is inappropriate), but clearing it (+i) always
prevents the shell becoming interactive.   Manipulating it later using
'set' (which is a non-standard usage) is not recommended, and can cause
the shell to behave in unexpected ways, so advise against attempts to
do so (in the manual).

In general, -i should be left for the shell to set/clear at startup time,
and then never be altered thereafter.


To generate a diff of this commit:
cvs rdiff -u -r1.127 -r1.128 src/bin/sh/jobs.c
cvs rdiff -u -r1.278 -r1.279 src/bin/sh/sh.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index