Navigation Menu

Skip to content

Commit

Permalink
ZSH USERS NOTE BACKWARD COMPATIBILITY WARNING!
Browse files Browse the repository at this point in the history
use cool PWD functionality in zsh precmd (and avoid a subshell) at
the expense of a kind of clunky if/else. Thanks @sorin-ionescu.
  • Loading branch information
rupa committed Aug 30, 2012
1 parent 3d896ea commit 9bf5feb
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions z.sh
Expand Up @@ -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
Expand Down

0 comments on commit 9bf5feb

Please sign in to comment.