path: root/Doc
diff options
authorPeter Stephenson <p.stephenson@samsung.com>2021-08-26 09:46:39 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2021-08-26 09:46:39 +0100
commit0a80579ed18b4004a99b5dc062ce874c0bdc3201 (patch)
treecb10342377e88c80e7f6dae58d1945f49be6501b /Doc
parent4a9437317fd374e983934d5b18c7d1d6ee041645 (diff)
49307 with doc update: POSIX_TRAPS fix.
With POSIX_TRAPS set, an ignored signal stays ignored when entering a subshell.
Diffstat (limited to 'Doc')
2 files changed, 12 insertions, 5 deletions
diff --git a/Doc/Zsh/grammar.yo b/Doc/Zsh/grammar.yo
index 2eb2018d2..f8f4ada86 100644
--- a/Doc/Zsh/grammar.yo
+++ b/Doc/Zsh/grammar.yo
@@ -288,7 +288,9 @@ for each selection until a break or end-of-file is encountered.
item(tt(LPAR()) var(list) tt(RPAR()))(
Execute var(list) in a subshell. Traps set by the tt(trap) builtin
-are reset to their default values while executing var(list).
+are reset to their default values while executing var(list); an
+exception is that ignored signals will continue to be ignored
+if the option tt(POSIXTRAPS) is set.
item(tt({) var(list) tt(}))(
Execute var(list).
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 546b16b65..4a8b85e08 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -2330,10 +2330,15 @@ When this option is set, the usual zsh behaviour of executing
traps for tt(EXIT) on exit from shell functions is suppressed.
In that case, manipulating tt(EXIT) traps always alters the global
trap for exiting the shell; the tt(LOCAL_TRAPS) option is
-ignored for the tt(EXIT) trap. Furthermore, a tt(return) statement
-executed in a trap with no argument passes back from the function the
-value from the surrounding context, not from code executed within the
+ignored for the tt(EXIT) trap.
+Also, a tt(return) statement executed in a trap with no argument passes
+back from the function the value from the surrounding context, not from
+code executed within the trap.
+Furthermore, if a trap is set to be ignored, this state persists when
+a subshell is entered. Without the option, the trap would be reset to
+its default state at this point.