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

3
tests/cd.err Normal file
View File

@@ -0,0 +1,3 @@
####################
# cd symlink non-resolution