Skip to content

fix: show symlinked files under their own name instead of target's name - #969

Open
toller892 wants to merge 1 commit into
charmbracelet:masterfrom
toller892:fix/symlink-display-name
Open

fix: show symlinked files under their own name instead of target's name#969
toller892 wants to merge 1 commit into
charmbracelet:masterfrom
toller892:fix/symlink-display-name

Conversation

@toller892

Copy link
Copy Markdown

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:

  1. printf '# Hello\n' > CLAUDE.md
  2. ln -s CLAUDE.md AGENTS.md
  3. glow

Result: two entries both named CLAUDE.md. Expected: one CLAUDE.md and one AGENTS.md.

Root Cause

stripAbsolutePath in ui/ui.go calls filepath.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 cwd in case the working directory itself is a symlink.

Fixes #965

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Symlinked markdown files appear as duplicates in the document list

1 participant