Feature Request: Make Links Clickable (Ctrl+Left Click to Open)
It would be very helpful if links (URLs) displayed in opencode were clickable, so that pressing Ctrl+left click on a link would open it in the default browser.
This is a common feature in many editors and terminal applications, and would improve usability when working with URLs in the interface.
Thank you!
Yes, opentui needs to support that. Will be possible soon.
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.
OpenTUI Changes:
- Add URL matching in the tree-sitter-styled-text.
- Register links in a registry to map screen positions to link IDs
- On option+leftclick TextBufferRenderable to lookup if theres a link at that position with callback with url
OpenCode Changes:
- Open the passed back URL
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