1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-24 15:04:13 +00:00
cde/src/cmd/ksh93/sh
Martijn Dekker 48ba6964ad Turn off SH_INTERACTIVE state flag in subshells
By definition, subshells are never interactive, so they should
disable behaviour associated with interactive shells even if the
main shell is interactive.

Most visibly, running a background job from a subshell like
	( some_command & )
now no longer prints a job ID that you cannot use in the main shell.
This behaviour change matches pdksh/mksh, bash, zsh, dash, et al.

Prior discussion:
https://www.mail-archive.com/austin-group-l@opengroup.org/msg06456.html
(plus the preceding thread)

src/cmd/ksh93/sh/subshell.c: sh_subshell():
- Before running the command(s) in the subshell using sh_exec(),
  turn off the SH_INTERACTIVE shell state flag. (No need to add
  code to restore it as this function already saves and restores
  the entire shell state.)

src/cmd/ksh93/bltins/misc.c: b_bg():
- If there is no job control when using 'bg', 'fg' or 'disown',
  always print the "no job control" error message and not only if
  the shell is in the interactive state. This is also what
  pdksh/mksh, bash and zsh do.
2020-10-02 08:07:28 +02:00
..
args.c Fix hang in comsubs (rhbz#1062296) (re: 970069a6) 2020-09-24 06:07:12 +02:00
arith.c -o posix: inverse-sync braceexpand; properly sync letoctal 2020-09-18 22:07:44 +02:00
array.c Fix several memory leaks related to arrays (rhbz#921455) 2020-09-15 07:47:38 +02:00
defs.c test/[: use a shell state bit (re: 7003aba4) 2020-08-30 05:33:59 +01:00
deparse.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
expand.c Remove legacy code for older libast versions 2020-09-04 02:31:39 +02:00
fault.c rm redundant getpid(2) syscalls (re: 9de65210) 2020-09-23 04:19:02 +02:00
fcin.c Fix parsing of multibyte characters 2020-06-12 01:45:17 +02:00
init.c combining alarm and IFS caused segfault (rhbz#1176670) 2020-09-27 03:03:48 +02:00
io.c Fix: Closing a FD within a comsub broke output (rhbz#1116072) 2020-09-27 04:46:24 +02:00
jobs.c rm redundant getpid(2) syscalls (re: 9de65210) 2020-09-23 04:19:02 +02:00
lex.c Fix lexing of 'case' in do...done in a $(comsub) (rhbz#1241013) 2020-09-27 21:26:09 +02:00
macro.c Allow turning off brace expansion in comsubs (rhbz#1078698) 2020-09-24 08:21:37 +02:00
main.c fix ksh login crash on disk full (rhbz#1212992) 2020-09-28 18:01:39 +02:00
name.c Fix 'typeset -xu', 'typeset -xl' (rhbz#1188377) 2020-09-30 03:06:54 +02:00
nvdisc.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
nvtree.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
nvtype.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
parse.c Fix 'command' expansion bug and POSIX compliance 2020-09-11 10:06:43 +02:00
path.c Fix $LINENO corruption when autoloading functions 2020-10-01 06:13:00 +02:00
pmain.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
shcomp.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
streval.c silence macro redefinition warnings (re: 7003aba4) 2020-06-16 04:51:21 +02:00
string.c Fix garbled output from Ctrl+Alt+V (#135) 2020-09-25 03:37:22 +01:00
subshell.c Turn off SH_INTERACTIVE state flag in subshells 2020-10-02 08:07:28 +02:00
suid_exec.c rm redundant getpid(2) syscalls (re: 9de65210) 2020-09-23 04:19:02 +02:00
tdump.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
timers.c rm redundant getpid(2) syscalls (re: 9de65210) 2020-09-23 04:19:02 +02:00
trestore.c '#if 0' cleanup 2020-08-30 04:51:20 +01:00
waitevent.c Version: 2012-08-01-master 2016-01-11 15:54:23 -05:00
xec.c Fix pipefail with (errexit or ERR trap) regression 2020-09-30 17:49:46 +02:00