fix: show symlinked files under their own name instead of target's name - #969
Open
toller892 wants to merge 1 commit into
Open
fix: show symlinked files under their own name instead of target's name#969toller892 wants to merge 1 commit into
toller892 wants to merge 1 commit into
Conversation
stripAbsolutePath called filepath.EvalSymlinks on the full path, which resolved symlinks and caused symlinked files to display under their target's name. For example, AGENTS.md -> CLAUDE.md would appear as two CLAUDE.md entries in the document list. Use the original path for display while still resolving cwd symlinks. Fixes charmbracelet#965
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.
Problem
Symlinked markdown files appear under their target's name in the TUI document list. If you have a real file and a symlink pointing at it, both show up with the same name, making them indistinguishable.
Reproduction:
printf '# Hello\n' > CLAUDE.mdln -s CLAUDE.md AGENTS.mdglowResult: two entries both named
CLAUDE.md. Expected: oneCLAUDE.mdand oneAGENTS.md.Root Cause
stripAbsolutePathinui/ui.gocallsfilepath.EvalSymlinks(fullPath), which resolves symlinks and rewrites the link's display name to its target.Fix
Use the original path for display instead of the resolved path. We still resolve
cwdin case the working directory itself is a symlink.Fixes #965