Conversation
zetashift
reviewed
May 11, 2024
| let mut cwd = CWD.write().unwrap(); | ||
| *cwd = Some(path.clone()); | ||
| // implementation of crossplatform pwd -L | ||
| // we want pwd -L so that symlinked directories are handeled correctly |
Contributor
There was a problem hiding this comment.
nit: it's handled not handeled.
the-mikedavis
self-requested a review
May 11, 2024 15:26
the-mikedavis
previously approved these changes
May 13, 2024
the-mikedavis
left a comment
Member
There was a problem hiding this comment.
Other than the typo this looks good! For context I use https://github.com/nix-community/impermanence so any long-lived files usually live under a symlink, for example ~/src/helix is a symlink to /nix/persist/home/michael/src/helix. So the difference between symlinks and regular files bites me fairly often. I've been testing this locally and it seems to work perfectly! Opening files with relative paths or relative paths with absolute paths (/home/michael/src/helix/README.md for example) properly shows them as relative in the statusline
archseer
reviewed
May 20, 2024
Vulpesx
pushed a commit
to Vulpesx/helix
that referenced
this pull request
Jun 7, 2024
…or#10728) * correctly handle opening helix inside symlinked directory * Update helix-stdx/src/env.rs --------- Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
smortime
pushed a commit
to smortime/helix
that referenced
this pull request
Jul 10, 2024
…or#10728) * correctly handle opening helix inside symlinked directory * Update helix-stdx/src/env.rs --------- Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
pcc
added a commit
to pcc/helix
that referenced
this pull request
May 13, 2025
…lix-editor#10728)" This reverts commit 8444f52. Temporary workaround for helix-editor#13520.
braydnm
pushed a commit
to braydnm/helix
that referenced
this pull request
Jul 5, 2025
…lix-editor#10728)" This reverts commit 8444f52. Temporary workaround for helix-editor#13520.
braydnm
pushed a commit
to braydnm/helix
that referenced
this pull request
Jul 5, 2025
…lix-editor#10728)" This reverts commit 8444f52. Temporary workaround for helix-editor#13520.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
get_current_directory alnways returns a cannonicalized path (since cwd is just a file descriptor that is passed to realpath). That means that opening any file inside a symlinked directory would show that file as an absolute path outised the cwd instead of as an relative path (since we don't cannonicalize/resolve symlinks normally). To fix that I made helix mirror the behavior of
pwd -L. We use PWD environment variable set by the shell which has a "memory" of which symlinks were transversed withcd.