mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
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:
parent
7999cd4f25
commit
6dc4ac60ae
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user