Skip to content

feat: Ctrl+Click links in terminal#207

Open
eugenioenko wants to merge 2 commits into
mainfrom
feat/terminal-ctrl-click-links
Open

feat: Ctrl+Click links in terminal#207
eugenioenko wants to merge 2 commits into
mainfrom
feat/terminal-ctrl-click-links

Conversation

@eugenioenko

Copy link
Copy Markdown
Owner

Summary

  • Detect URLs (https://...) and file references (path/file.go:42) in terminal output
  • Highlight detected links with cornflower blue underline during rendering
  • Ctrl+Click opens URLs in the browser (xdg-open) and file references in the editor at the specified line
  • Supports absolute paths, ./ relative paths, ~/ home-relative paths, and bare relative paths (e.g. main.go:7 from compiler output)
  • File paths are resolved relative to the workspace root and validated with os.Stat before being treated as links

Test plan

  • Unit tests for URL detection (simple, query params, trailing punctuation, multiple, parenthesized, fragments)
  • Unit tests for file reference detection (relative, absolute, bare paths, nested, non-existent, error output context)
  • Unit tests for mixed URL + file detection, span positions, edge cases
  • Unit tests for resolveFilePath (tilde expansion, empty input)
  • Manual: open terminal, run echo https://example.com, Ctrl+Click opens browser
  • Manual: open terminal, run go build with errors, Ctrl+Click on file.go:line opens file at line

🤖 Generated with Claude Code

eugenioenko and others added 2 commits June 18, 2026 23:57
URLs and file:line references in terminal output are highlighted with
underline + blue color. Ctrl+Click opens URLs in the browser and file
references in the editor at the specified line.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ix offsets

- Only underline links (no color override) for subtler visual hint
- Only detect links when Ctrl is held (via mouse events), zero overhead otherwise
- Fix byte-to-rune position conversion so link spans align with terminal columns

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@eugenioenko eugenioenko force-pushed the feat/terminal-ctrl-click-links branch from 9aa6785 to f187948 Compare June 19, 2026 07:11
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