Skip to content

Commit

Permalink
Allow zsh shellcode to be reentrant
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Sep 17, 2023
1 parent 37e6563 commit 76fb33c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modes/shellcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,13 @@ export default function() {
if [ -n "$ZSH_VERSION" ] && [ $(emulate) = zsh ]; then
eval 'typeset -ag chpwd_functions
if [[ -z "\${chpwd_functions[(r)_tea_hook]+1}" ]]; then
if [[ -z "\${chpwd_functions[(r)_tea_chpwd_hook]+1}" ]]; then
chpwd_functions=( _tea_chpwd_hook \${chpwd_functions[@]} )
fi
[ "$TERM_PROGRAM" != Apple_Terminal ] && _tea_chpwd_hook
if [ "$TERM_PROGRAM" != Apple_Terminal ]; then
_tea_chpwd_hook
fi
_tea() {
local words
Expand Down

0 comments on commit 76fb33c

Please sign in to comment.