Don't resolve symlinks with cd

This switches fish to a "virtual" PWD, where it no longer uses getcwd to
discover its PWD but instead synthesizes it based on normalizing cd against
the $PWD variable.

Both pwd and $PWD contain the virtual path. pwd is taught about -P to
return the physical path, and -L the logical path (which is the default).

Fixes #3350
This commit is contained in:
ridiculousfish
2018-09-16 18:03:13 -07:00
parent 6ad4d94e12
commit 0f0bb1e10f
14 changed files with 95 additions and 47 deletions

View File

@@ -18,6 +18,8 @@ function mktemp
set opts $opts d
case -t
set opts $opts t
case -u
set opts $opts u
case --
set -e argv[1]
break
@@ -69,6 +71,9 @@ function mktemp
end
set -l args
if contains u $opts
set args $args -u
end
if contains d $opts
set args $args -d
end
@@ -88,7 +93,7 @@ function mktemp
end
set args $args $template
command mktemp $args
realpath (command mktemp $args)
end
function _mktemp_help