When handling bookmark, use readlink, not realpath #1773
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is to cd to path as it pointed by symlink, not to it's real path. Bookmarked directory may itself contain symlinks in path, which should be respected.
For example: if directory is physically in
/mnt/storage/some
and it's symlinked to~/some
and directory~/some/dir
added to bookmarks, it's reasonable to expect that when following bookmark directory will be changed to~/some/dir
(as in bookmark's link) not to/mnt/storage/some/dir
(as dir real path).It's reasonable to expect this behavior because this follows the
cd
behavior (both shellcd
andnnn
changing directory) when changing directory into symlink.Also, with behavior as in this PR user can have both bookmarks to "short" path (i.e.
~/some/dir
in example above) and long path (i.e./mnt/storage/some/dir
) - which path is actually bookmarked, that path will be followed. Original behavior disallows using bookmarks to go to "short" path.