ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
use cool PWD functionality in zsh precmd (and avoid a subshell) at the expense of a kind of clunky if/else. Thanks @sorin-ionescu.
This commit is contained in:
1 parent
3d896ea6c4
commit
9bf5feb86a
1 file changed
+9
-3
@@ -188,9 +188,15 @@ if complete &> /dev/null; then
|
||||
elif compctl &> /dev/null; then
|
||||
[ "$_Z_NO_PROMPT_COMMAND" ] || {
|
||||
# populate directory list, avoid clobbering any other precmds
|
||||
_z_precmd() {
|
||||
_z --add "$(pwd $_Z_RESOLVE_SYMLINKS)"
|
||||
}
|
||||
if [ "$_Z_NO_RESOLVE_SYMLINKS" ]; then
|
||||
_z_precmd() {
|
||||
_z --add "${PWD:a}"
|
||||
}
|
||||
else
|
||||
_z_precmd() {
|
||||
_z --add "${PWD:A}"
|
||||
}
|
||||
fi
|
||||
precmd_functions+=(_z_precmd)
|
||||
}
|
||||
# zsh tab completion
|
||||
|
||||
Reference in new issue
Block a user