Skip to content

feat(terminal): add clickable file path links#43

Closed
maskar wants to merge 0 commit intojohannesjo:mainfrom
maskar:pr/terminal-file-links
Closed

feat(terminal): add clickable file path links#43
maskar wants to merge 0 commit intojohannesjo:mainfrom
maskar:pr/terminal-file-links

Conversation

@maskar
Copy link
Copy Markdown
Contributor

@maskar maskar commented Mar 28, 2026

Summary

File paths in terminal output are now highlighted and clickable. Clicking opens the file with the system default handler.

Supports:

  • Absolute paths: /Users/foo/bar.ts
  • Relative paths: ./src/lib/theme.ts, ../package.json
  • Bare relative: src/components/Foo.tsx
  • Scoped packages: @xterm/xterm/typings/xterm.d.ts
  • Line/col suffixes: src/App.tsx:42:10 (stripped before opening)
  • Trailing punctuation is stripped (e.g. file.md.file.md)

Also adds an onFileLink callback prop to TerminalView for parent components to handle specific file types differently.

Test plan

  • File paths in terminal output are underlined on hover
  • Clicking a file path opens it in the default application
  • Paths with :line:col suffixes are recognized and opened correctly
  • Trailing punctuation (., ,, )) is not included in the link

@johannesjo
Copy link
Copy Markdown
Owner

Very nice addition! Could you have a look at the conflicts?

@maskar maskar closed this Mar 28, 2026
@maskar maskar force-pushed the pr/terminal-file-links branch from 81d9da5 to 9ce6abe Compare March 28, 2026 16:01
@maskar
Copy link
Copy Markdown
Contributor Author

maskar commented Mar 28, 2026

Rebased on latest main, conflicts resolved.

@johannesjo
Copy link
Copy Markdown
Owner

Thank you! Was closing this intentional?

@maskar
Copy link
Copy Markdown
Contributor Author

maskar commented Mar 28, 2026

No, not intentional — the force push after rebasing may have caused GitHub to auto-close it. I can't reopen it (GitHub error). Want me to open a fresh PR from the same branch?

@johannesjo
Copy link
Copy Markdown
Owner

johannesjo commented Mar 28, 2026

Want me to open a fresh PR from the same branch? Yes, that would be great! Though I think I might have somehow merged this. Maybe together with one of the other PRs?

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.

2 participants