about summary refs log tree commit diff
path: root/README
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-02-17 10:40:55 +0000
committerPeter Stephenson <pws@zsh.org>2016-02-17 10:40:55 +0000
commitab74c86edb30fa04fda5fe7fa01e404334f7c2b0 (patch)
tree096002145a76bca90e09c2dc511008f33145acc2 /README
parentf96a0167289d41d583b01b17482bba0641be2805 (diff)
downloadzsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.gz
zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.tar.xz
zsh-ab74c86edb30fa04fda5fe7fa01e404334f7c2b0.zip
37999: Sticky behaviour of EXIT traps.
They now have POSIX or non-POSIX behaviour based on the setting
of POSIX_TRAPS where the trap was defined, rather than where the
trap would (or would not) be executed.

Tweaks possible.
Diffstat (limited to 'README')
-rw-r--r--README14
1 files changed, 14 insertions, 0 deletions
diff --git a/README b/README
index 8b8ab5731..d5343db19 100644
--- a/README
+++ b/README
@@ -65,6 +65,20 @@ remainder of the value discarded.  This could lead to different behaviour
 if the argument contains non-numeric characters, or if the argument has
 leading zeroes and the OCTAL_ZEROES option is set.
 
+3) For some time the shell has had a POSIX_TRAPS option which determines
+whether the EXIT trap has POSIX behaviour (the trap is only run at shell
+exit) or traditional zsh behaviour (the trap is run once and discarded
+when the enclosing fuction or shell exits, whichever happens first).
+The use of this option has now been made "sticky" on the EXIT trap ---
+in other words, the setting of the option at the point where the trap is
+set now determines whether the trap has POSIX or traditional zsh
+behaviour.  This means that changing the option after the trap was set
+no longer has any effect.
+
+Other aspects of EXIT trap handling have not changed --- there is still
+only one EXIT trap at any point in a programme, so it is not generally
+useful to combine POSIX and non-POSIX behaviour in the same script.
+
 Incompatibilities between 5.0.8 and 5.2
 ---------------------------------------