-
Notifications
You must be signed in to change notification settings - Fork 689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clickable URLs #29
Comments
Looking at other terminals, it looks like the ones I like do this using a more generic "match regexp => associate action" system. I like that idea, but it makes this feature request quite large! Its still very important to do. So thinking out loud (I haven't looked at how others implement it, just how they configure it): I'd probably implement this in the renderer thread. It is far too expensive to be running regular expressions on terminal input on the hot path of updating terminal state. Instead, we should probably just process the regular expressions on visible text that happens relatively infrequently in the renderer (60 to 150 Hz). This will probably also necessitate the first time where the renderer has to be able to communicate back to the windowing thread because it will have to communicate where the clickable zones are and what action they correspond to. We have good inter-thread messaging systems in place and the windowing thread already has a mailbox so this won't be a big deal. Likewise, once the window is aware of these clickable areas, it'll have to send messages back to the rendering thread for when they're hovered so that hover-styling can be applied. We already have a mechanism for this, as well. |
@mitchellh if this functionality only worked while |
We could, not sure if the performance at that point will matter though. Typically, the renderer is not constrained and is able to always maintain at least 60 fps with a lot of idle time in the middle. |
Just noting from #383 that this should include support for OSC 8. |
I've used this pattern in the past to great effect https://github.com/nektro/mantle/blob/db5c55e/www/chat/js/x/x-msg-pane.js#L40 |
Throwing in my two cents here. Clickable is a must, but it would be extra cool to also have hints for those less mouse-inclined. Here's how foot does it. Default bind is Ctrl+Shift+O, then you press the letter of the hint and it opens in your configured mime handler. 1695932557.mp4 |
Kitty, Alacritty, and Wezterm all have that feature too. It's very nice, I missed it when using iTerm. |
|
Why limit to URLs? When I get zig compilation error in |
I have no plans to limit this to URLs! See my original response, where I describe my desire for a generalized system. |
A PR is now up with initial URL support #968. I plan to follow up with improvements in follow-up PRs. What is/isn't supported is clear in the PR body. |
I would deeply appreciate it if we can support the URxvt style extensions here, such as hotkey-based URL selection, etc: https://github.com/xyb3rt/urxvt-perls |
@mitchellh ![]() |
I also just switched to ghostty (from ptyxis and tilix), and this is the only feature I'm missing. Looking forward to this 😃 |
It's convenient to be able to click a link in the terminal instead of having to copy paste it.
Sibling project behavior:
cmd
.The text was updated successfully, but these errors were encountered: