[FEATURE]: Ability to click to open links in CLI #3664

Closed
opened 2026-02-16 17:41:02 -05:00 by yindo · 2 comments
Owner

Originally created by @thehamsti on GitHub (Dec 19, 2025).

Originally assigned to: @kommander on GitHub.

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

In a lot of other TUI's as well as just plain CLI output you can cmd+left click (on MacOS -- i think its alt+left click elsewhere?) and it will open the link in your default browser. In OpenCode you are unable to do this. You have to highlight the link, copy it, and then go to your browser to open it.

Benefits:

  • Much, much better UX
  • Better feature matching with base CLI implementation

How I would implement it?

It would have to be a OpenTUI library change. (I actually made a POC to see even if it was possible) This is what i found.

  1. Add URL matching in the tree-sitter-styled-text.
  2. Register links in a registry to map screen positions to link IDs
  3. On option+leftclick TextBufferRenderable to lookup if theres a link at that position
  • Then make a callback with the URL if there is a link

Note:
We can't use the cmd+click because seemingly the terminal mouse protocol only supports shift/alt/ctrl modifiers.

Originally created by @thehamsti on GitHub (Dec 19, 2025). Originally assigned to: @kommander on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request In a lot of other TUI's as well as just plain CLI output you can cmd+left click (on MacOS -- i think its alt+left click elsewhere?) and it will open the link in your default browser. In OpenCode you are unable to do this. You have to highlight the link, copy it, and then go to your browser to open it. ### Benefits: * Much, much better UX * Better feature matching with base CLI implementation ### How I would implement it? It would have to be a OpenTUI library change. (I actually made a POC to see even if it was possible) This is what i found. 1. Add URL matching in the tree-sitter-styled-text. 2. Register links in a registry to map screen positions to link IDs 3. On option+leftclick TextBufferRenderable to lookup if theres a link at that position * Then make a callback with the URL if there is a link *Note:* We can't use the cmd+click because seemingly the terminal mouse protocol only supports shift/alt/ctrl modifiers.
yindo added the opentuidiscussion labels 2026-02-16 17:41:02 -05:00
yindo closed this issue 2026-02-16 17:41:02 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 19, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1168: Feature Request: Make Links Clickable (Ctrl+Left Click to Open)
  • #4381: [FEATURE]: Clickable links

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 19, 2025): This issue might be a duplicate of existing issues. Please check: - #1168: Feature Request: Make Links Clickable (Ctrl+Left Click to Open) - #4381: [FEATURE]: Clickable links Feel free to ignore if none of these address your specific case.
Author
Owner

@thehamsti commented on GitHub (Dec 19, 2025):

Ah crap it is a duplicate -- regardless here are links to the forked branch POC. I can clean it up if you want me to proceed with the strategy and make a PR, or if you guys were planning on a different way 👍🏼

https://github.com/sst/opencode/compare/dev...thehamsti:opencode:feature/clickable_links?expand=1
https://github.com/sst/opentui/compare/main...thehamsti:opentui:feature/osc8-hyperlinks?expand=1

@thehamsti commented on GitHub (Dec 19, 2025): Ah crap it is a duplicate -- regardless here are links to the forked branch POC. I can clean it up if you want me to proceed with the strategy and make a PR, or if you guys were planning on a different way 👍🏼 https://github.com/sst/opencode/compare/dev...thehamsti:opencode:feature/clickable_links?expand=1 https://github.com/sst/opentui/compare/main...thehamsti:opentui:feature/osc8-hyperlinks?expand=1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3664