Use $PWD to retrieve the current directory in __fish_move_last.

(command pwd) uses the system's implementation of pwd. At least the GNU
coreutils implementation defaults to -P, which resulted in symlinks being
expanded when switching between directories with nextd/prevd.
This commit is contained in:
Peter Collingbourne 2019-12-06 11:22:18 -08:00 committed by Fabian Homborg
parent 7999cd4f25
commit 6dc4ac60ae
2 changed files with 3 additions and 1 deletions

View File

@ -12,7 +12,7 @@ function __fish_move_last -d "Move the last element of a directory history from
end
# Append current dir to the end of the destination
set -g (echo $dest) $$dest (command pwd)
set -g (echo $dest) $$dest $PWD
set ssrc $$src

View File

@ -9,6 +9,8 @@ set real (mktemp -d)
set link $base/link
ln -s $real $link
cd $link
prevd
nextd
test "$PWD" = "$link" || echo "\$PWD != \$link:"\n "\$PWD: $PWD"\n "\$link: $link"\n
test (pwd) = "$link" || echo "(pwd) != \$link:"\n "\$PWD: "(pwd)\n "\$link: $link"\n
test (pwd -P) = "$real" || echo "(pwd -P) != \$real:"\n "\$PWD: $PWD"\n "\$real: $real"\n