Files
fish-shell/share/functions/cd.fish
axel 433169dca4 Avoid using the pwd command in favour of the $PWD variable, since the pwd command does not seem to work well with fuse
darcs-hash:20060529130753-ac50b-0d32fe0924dbf9e83520d26402e9daae77789419.gz
2006-05-29 23:07:53 +10:00

36 lines
578 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 $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 $PWD != $previous
set -g dirprev $dirprev $previous
set -e dirnext
set -g __fish_cd_direction prev
end
return $status
end