Skip to content

feat: add hyperlink support to GitBranch and GitRootDir widgets#224

Open
ereli-sevenai wants to merge 2 commits intosirmalloc:mainfrom
ereli-sevenai:main
Open

feat: add hyperlink support to GitBranch and GitRootDir widgets#224
ereli-sevenai wants to merge 2 commits intosirmalloc:mainfrom
ereli-sevenai:main

Conversation

@ereli-sevenai
Copy link

Summary

  • Git Branch gains a (l)ink to GitHub toggle: when enabled, the branch name becomes a clickable OSC 8 terminal hyperlink pointing to https://github.com/owner/repo/tree/<branch>. Only activates when the git remote is a GitHub URL — non-GitHub remotes display plain text.
  • Git Root Dir gains a (l)ink to Cursor toggle: when enabled, the project/subtree root name becomes a clickable cursor://file/<path> hyperlink that opens the directory in Cursor.
  • New shared utility src/utils/hyperlink.ts provides renderOsc8Link and parseGitHubBaseUrl helpers, used by both widgets.

Test plan

  • In TUI, select Git Branch widget, press l to toggle GitHub link on/off — modifier text shows (GitHub link) when active
  • In a GitHub-hosted repo, status line branch name is clickable and opens the correct GitHub tree URL
  • In a non-GitHub repo (GitLab, Bitbucket, etc.), branch displays as plain text even with link enabled
  • In TUI, select Git Root Dir widget, press l to toggle Cursor link on/off — modifier text shows (Cursor link) when active
  • Status line project root name is clickable and opens the directory in Cursor
  • All 17 existing GitBranch + GitRootDir tests still pass

🤖 Generated with Claude Code

ereli-sevenai and others added 2 commits March 12, 2026 14:36
- GitBranch: toggle (l)ink wraps branch name in OSC 8 link to
  github.com/owner/repo/tree/<branch>; only activates for GitHub
  remotes, falls back to plain text otherwise
- GitRootDir: toggle (l)ink wraps project root name in OSC 8
  cursor://file/<path> link to open the directory in Cursor
- Add shared src/utils/hyperlink.ts with renderOsc8Link and
  parseGitHubBaseUrl helpers

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
feat: add hyperlink support to GitBranch and GitRootDir widgets
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