tcsh: preserve any existing `precmd` alias

This commit is contained in:
Ajeet D'Souza 2026-06-30 12:09:25 +05:30
parent 6f79755f1a
commit efa22f644a
2 changed files with 10 additions and 1 deletions

View File

@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Zsh: avoid inserting a trailing space when cancelling interactive Space-Tab completions. - Zsh: avoid inserting a trailing space when cancelling interactive Space-Tab completions.
- Bash: avoid blanking the prompt when cancelling interactive Space-Tab completions. - Bash: avoid blanking the prompt when cancelling interactive Space-Tab completions.
- Bash/Fish/Zsh: avoid drawing a new line when Space-Tab completion finds no matches. - Bash/Fish/Zsh: avoid drawing a new line when Space-Tab completion finds no matches.
- Tcsh: preserve any existing `precmd` alias instead of overwriting it.
## [0.9.9] - 2026-01-31 ## [0.9.9] - 2026-01-31

View File

@ -23,7 +23,15 @@ alias __zoxide_hook 'set __zoxide_pwd_tmp = "`{{ pwd_cmd }}`"; test "$__zoxide_p
{%- endif %} {%- endif %}
# Initialize hook. # Initialize hook.
alias precmd ';__zoxide_hook' set __zoxide_precmd = "`alias precmd`"
if ( "$__zoxide_precmd" !~ *__zoxide_hook* ) then
if ( "$__zoxide_precmd" == "" ) then
alias precmd '__zoxide_hook'
else
alias precmd "$__zoxide_precmd"';__zoxide_hook'
endif
endif
unset __zoxide_precmd
{%- endif %} {%- endif %}