[bug]: zsh chokes on unbound variables
LucasLarson opened this issue · comments
Describe the bug
when zsh’s NO_UNSET
option is enabled,1 fast-syntax-highlighting begins to needlessly choke zsh
Steps to reproduce
run the following
$ git clone https://github.com/zdharma-continuum/fast-syntax-highlighting /tmp/fast-syntax-highlighting
$ cd /tmp/fast-syntax-highlighting
# run any of the following
$ zsh -dfuc 'autoload -Uz compinit add-zsh-hook; compinit; add-zsh-hook preexec _zsh_highlight_preexec_hook; fpath=/tmp/fast-syntax-highlighting; source /tmp/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh'
# or this
$ zsh -dfu /tmp/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
# or this
$ zsh -dfnu /tmp/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh
Expected behavior
[no output]
Screenshots and recordings
No response
Operating System & Version
darwin22.1.0 | apple | x86_64 | x86_64 | x86_64 unknown
Zsh version
zsh 5.9 (x86_64-apple-darwin22.1.0)
Terminal emulator
iTerm Build 3.5.20230323-nightly; xterm-256-color
If using WSL on Windows, which version of WSL
None
Additional context
No response
Footnotes
-
setopt nounset
/set -u
/set -o nounset
/zsh -u
↩