Skip to content

fix: markdown preview resolves ~/... paths - #64

Merged
aterrylu merged 1 commit into
mainfrom
terry/fix-preview-paths
Mar 25, 2026
Merged

fix: markdown preview resolves ~/... paths#64
aterrylu merged 1 commit into
mainfrom
terry/fix-preview-paths

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Ctrl+clicking ~/.claude/plans/foo.md in terminal now works. Client stops prepending workingDirectory to ~/ paths, server expands ~ to $HOME.

Two fixes for "File not found" when Ctrl+clicking ~/path/file.md:

Client (useTerminal.ts):
- Paths starting with ~/ are no longer treated as relative
- Previously prepended workingDirectory, creating garbage paths
- Now: / = absolute, ~/ = home-relative (server expands), else = relative

Server (files.ts):
- safePath() now expands ~/ to $HOME/ before resolve()
- node:path.resolve() treats ~ as literal — expansion is required
- Both /read and /watch routes go through safePath, so both are fixed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu merged commit 493b300 into main Mar 25, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/fix-preview-paths branch March 25, 2026 07:47
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.

1 participant