diff options
author | Peter Stephenson <pws@zsh.org> | 2013-10-17 10:14:25 +0100 |
---|---|---|
committer | Peter Stephenson <pws@zsh.org> | 2013-10-17 10:14:25 +0100 |
commit | 73ececfd01bc137366d25940d90a34aaa2cdb02e (patch) | |
tree | db9a9969a06a81fe1efafa38829e6e1a44f5eddc /Doc/Zsh | |
parent | a8f736b4cf8d186af4aea6f48ae7a5335d9ad8bb (diff) | |
download | zsh-73ececfd01bc137366d25940d90a34aaa2cdb02e.tar.gz zsh-73ececfd01bc137366d25940d90a34aaa2cdb02e.tar.xz zsh-73ececfd01bc137366d25940d90a34aaa2cdb02e.zip |
31830: New feature for zshaddhistory hooks.
If the first non-zero return status is 2, save the line on the internal history list, but don't write it out.
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/func.yo | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo index 1f58df86a..6e9cfeee9 100644 --- a/Doc/Zsh/func.yo +++ b/Doc/Zsh/func.yo @@ -264,9 +264,16 @@ Executed when a history line has been read interactively, but before it is executed. The sole argument is the complete history line (so that any terminating newline will still be present). -If any of the hook functions return a non-zero value the history -line will not be saved, although it lingers in the history until the -next line is executed, allowing you to reuse or edit it immediately. +If any of the hook functions returns status 1 (or any non-zero value +other than 2, though this is not guaranteed for future versions of the +shell) the history line will not be saved, although it lingers in the +history until the next line is executed, allowing you to reuse or edit +it immediately. + +If any of the hook functions returns status 2 the history line +will be saved on the internal history list, but not written to +the history file. In case of a conflict, the first non-zero status +value is taken. A hook function may call `tt(fc -p) var(...)' to switch the history context so that the history is saved in a different file from the |