Keyboard navigation of clickable link #9226

Closed
opened 2026-01-31 01:49:08 +00:00 by claunia · 3 comments
Owner

Originally created by @mithrandir on GitHub (Jun 24, 2020).

Description of the new feature/enhancement

Keyboard navigation of clickable link in terminal text. Terminal Roadmap v2.0 is describing about clickable link

| Hyperlinking any links that appear in the text buffer. When clicking on the link, the link will open in your default browser.

However, this involves pointing device such as mouse or trackball. I believe many of terminal users love keyboard and it is important to keep using keyboard without switching to pointing device as much as possble.

Proposed technical implementation details (optional)

We may have a command like "NavigateToPreviousClickableLink" or "NavtigateToNextClickableLink" and "InvokeFocusedClickableLink", then we can reassign key binding those command.

bentaudun commented as https://github.com/microsoft/terminal/issues/204#issuecomment-640016016 but wasn't mentioned in https://github.com/microsoft/terminal/issues/574

Originally created by @mithrandir on GitHub (Jun 24, 2020). # Description of the new feature/enhancement Keyboard navigation of clickable link in terminal text. [Terminal Roadmap v2.0](https://github.com/microsoft/terminal/blob/master/doc/terminal-v2-roadmap.md) is describing about clickable link | Hyperlinking any links that appear in the text buffer. When clicking on the link, the link will open in your default browser. However, this involves pointing device such as mouse or trackball. I believe many of terminal users love keyboard and it is important to keep using keyboard without switching to pointing device as much as possble. # Proposed technical implementation details (optional) We may have a command like "NavigateToPreviousClickableLink" or "NavtigateToNextClickableLink" and "InvokeFocusedClickableLink", then we can reassign key binding those command. bentaudun commented as https://github.com/microsoft/terminal/issues/204#issuecomment-640016016 but wasn't mentioned in https://github.com/microsoft/terminal/issues/574
Author
Owner

@zadjii-msft commented on GitHub (Jun 24, 2020):

I agree this would be super useful. I'd think we could probably leave out InvokeFocusedClickableLink, and just leave that as space or enter, but now as I'm typing this up, maybe people would want to navigate to the previous link, then copy it, then return to the input line and paste it? So maybe another action for that makes sense? Though, we can't have multiple actions bound to the same key, so that wouldn't work with "enter to copy" people...

I'm maybe rambling a bit.

This is a good idea for inclusion once #574/#204 lands.

@zadjii-msft commented on GitHub (Jun 24, 2020): I agree this would be super useful. I'd think we could probably leave out `InvokeFocusedClickableLink`, and just leave that as <kbd>space</kbd> or <kbd>enter</kbd>, but now as I'm typing this up, maybe people would want to navigate to the previous link, then copy it, then return to the input line and paste it? So maybe another action for that makes sense? Though, we can't have multiple actions bound to the same key, so that wouldn't work with "<kbd>enter</kbd> to copy" people... I'm maybe rambling a bit. This is a good idea for inclusion once #574/#204 lands.
Author
Owner

@carlos-zamora commented on GitHub (May 16, 2022):

Copying some ideas from the dup I accidentally made...

Description of the new feature/enhancement

Windows Terminal supports automatic detection of hyperlinks and allows you to open the hyperlink using your mouse (specifically ctrl+clicking the link). I've realized that there's no way to do this using only the keyboard.

Once mark mode lands, the solution is a little better, but still far from perfect and on par. The user would be able to navigate to the text with the hyperlink, create a selection that encompasses it, copy the URL, then manually open it in their preferred web browser.

What if we could make this a nicer experience? Consider this...

  1. enter mark mode
  2. tab (or shift+tab) to navigate to these hyperlinks
  3. when you've navigated to the hyperlink, a selection is created that encompasses the relevant hyperlink.
  4. enter can be used to invoke the hyperlink directly

Some corner cases...

  • what if enter is bound to an action (like "copy")? --> prefer the action
  • what if we add more bookmark-like things like "prompt position" or user-configured bookmarks --> might as well navigate to them too? I'm thinking these can be tab stops.

From Mike...

Oh man do I have thoughts in https://github.com/microsoft/terminal/issues/11000.

@carlos-zamora commented on GitHub (May 16, 2022): Copying some ideas from the dup I accidentally made... # Description of the new feature/enhancement Windows Terminal supports automatic detection of hyperlinks and allows you to open the hyperlink using your mouse (specifically ctrl+clicking the link). I've realized that there's no way to do this using only the keyboard. Once mark mode lands, the solution is a little better, but still far from perfect and on par. The user would be able to navigate to the text with the hyperlink, create a selection that encompasses it, copy the URL, then manually open it in their preferred web browser. What if we could make this a nicer experience? Consider this... 1. enter mark mode 2. <kbd>tab</kbd> (or <kbd>shift+tab</kbd>) to navigate to these hyperlinks 3. when you've navigated to the hyperlink, a selection is created that encompasses the relevant hyperlink. 4. <kbd>enter</kbd> can be used to invoke the hyperlink directly Some corner cases... - what if <kbd>enter</kbd> is bound to an action (like "copy")? --> prefer the action - what if we add more bookmark-like things like "prompt position" or user-configured bookmarks --> might as well navigate to them too? I'm thinking these can be tab stops. From Mike... > Oh man do I have thoughts in https://github.com/microsoft/terminal/issues/11000.
Author
Owner

@ghost commented on GitHub (Sep 13, 2022):

:tada:This issue was addressed in #13405, which has now been successfully released as Windows Terminal Preview v1.16.252.🎉

Handy links:

@ghost commented on GitHub (Sep 13, 2022): :tada:This issue was addressed in #13405, which has now been successfully released as `Windows Terminal Preview v1.16.252`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.16.252) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9226