Skip to content

feat: add clickable file path links in terminal#77

Merged
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/clickableTerminalLinks
Mar 24, 2026
Merged

feat: add clickable file path links in terminal#77
AmethystLiang merged 1 commit intomainfrom
AmethystLiang/clickableTerminalLinks

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Summary

  • Add terminal link detection that recognizes file paths (absolute and relative) with optional :line:column suffixes, opening them in the built-in editor or externally
  • Split the single shell:openExternal IPC handler into dedicated openUrl, openFilePath, openFileUri, and pathExists handlers with proper URL parsing and path validation
  • Register xterm link providers per terminal pane with path existence caching, and support OSC 8 hyperlinks for http(s) and file: protocols
  • Add orca:editor-reveal-location custom event so clicking a terminal link jumps the Monaco editor to the exact line/column

Test plan

  • Verify clicking a file path like src/main/index.ts:10:5 in the terminal opens the file at line 10, column 5 in the editor
  • Verify relative paths (e.g., ./src/foo.ts) resolve against the terminal's cwd
  • Verify http/https URLs still open in the default browser
  • Verify file: URIs open the file externally
  • Verify non-existent paths are not clickable
  • Verify paths outside the worktree open externally rather than in the editor

🤖 Generated with Claude Code

- Add terminal link detection that recognizes file paths with optional
  line:column suffixes and opens them in the editor or externally
- Split shell IPC into separate openUrl, openFilePath, openFileUri, and
  pathExists handlers with proper URL/path validation
- Register xterm link providers per pane with path existence caching
- Support OSC 8 hyperlinks for http(s) and file: protocols
- Add editor-reveal-location custom event for jumping to line/column

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@AmethystLiang AmethystLiang merged commit 20cfa1f into main Mar 24, 2026
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