fish-shell/share/functions/cd.fish
axel c2f6c6c1d2 Do gettext translation of descriptions just-in-time internally in fish
darcs-hash:20060301165347-ac50b-3df9feec60dd9860e0988396d10b550a501f6802.gz
2006-03-02 02:53:47 +10:00

35 lines
596 B
Fish

#
# The following functions add support for a directory history
#
function cd -d (N_ "Change directory")
# Skip history in subshells
if status --is-command-substitution
builtin cd $argv
return $status
end
# Avoid set completions
set previous (command pwd)
if test $argv[1] = - ^/dev/null
if test $__fish_cd_direction = next ^/dev/null
nextd
else
prevd
end
return $status
end
builtin cd $argv[1]
if test $status = 0 -a (command pwd) != $previous
set -g dirprev $dirprev $previous
set -e dirnext
set -g __fish_cd_direction prev
end
return $status
end