Scenario: Add support for hyperlinks #6974

Open
opened 2026-01-31 00:52:03 +00:00 by claunia · 45 comments
Owner

Originally created by @zadjii-msft on GitHub (Mar 18, 2020).

Originally assigned to: @PankajBhojwani on GitHub.

This is the the megathread for tracking all the remaining work that needs to be done for hyperlink support in Terminal.

"Soon" Timeframe

Backlog

References

Originally created by @zadjii-msft on GitHub (Mar 18, 2020). Originally assigned to: @PankajBhojwani on GitHub. This is the the megathread for tracking all the remaining work that needs to be done for hyperlink support in Terminal. ### "Soon" Timeframe * [x] Original issue: #204 -> added in #7251 * [x] Allow `file://` URIs -> added in #7526 * [ ] #7562 Allow other URI schemes * [x] Render hyperlinks differently from regular text in Terminal -> added in #7420 * [x] Hover underline text that have the same hyperlink ID and display the URI -> added in #7420 * [x] Display a content dialog box for URIs we cannot parse/schemes we do not support -> added in #7523 * [x] https://github.com/microsoft/terminal/issues/574 Add support for Terminal to auto-detect hyperlinks -> added in #7691 * [ ] #7563 Switch the pointer to the 👆 icon when we're hovering a link (in the clickable state, like with ctrl pressed) * [ ] `VtEngine::_SetHyperlink` uses `fmt::format` to render the hyperlinks, and it should really use `_WriteFormattedString` * [ ] #7564 Hook up hyperlinks to conhost (rendering + clicking) * [ ] #7565 Make sure hyperlinks are included in HTML copy * [x] #8123 Only underline hyperlinks on hover -> added in #8148 * [ ] ~Controlling tooltip delay for URLs #8242~ - Abandoned, platform limitation * [x] ~Add a setting to disable auto detection of links (in PR #8239)~ - Abandoned, we're not sure anyone actually ever wanted this * [x] Links/URLs get offset when certain unicode characters are printed #8709 * [x] #9117 * [x] #6649 * [ ] #11901 ### Backlog * [ ] Add a setting to configure the regex used to detect patterns * [ ] #8849 - Theoretically, this could supersede #7562 - Should be self-consistent with #8294 * [ ] Control the styling of hyperlinks - attributes used for autodetected hyperlinks, and then different attributes for hovered ones #8294 * [ ] #2671 ### References * This VsCode issue has an enormous set of references to improvements they've made: https://github.com/microsoft/vscode/issues/172084 * #15700
claunia added the Area-VTProduct-TerminalArea-UserInterfaceIssue-Scenario labels 2026-01-31 00:52:03 +00:00
Author
Owner

@DHowett commented on GitHub (Aug 20, 2020):

Proposed order of attack:

  • Hover tooltip
  • Rendering -- possibly simple rendering w/ a new underline style for me?
  • Take a break, regroup, think about the design for autodetection
  • (possibly work on other things in the meantime)
  • Autodetection
@DHowett commented on GitHub (Aug 20, 2020): Proposed order of attack: * Hover tooltip * Rendering -- possibly simple rendering w/ a new underline style for me? * Take a break, regroup, think about the design for autodetection * (possibly work on other things in the meantime) * Autodetection
Author
Owner

@zadjii-msft commented on GitHub (Aug 21, 2020):

Hey so hover tooltip might be hard - we can't embed a webview, so doing something like
image

Might be especially hard. But we could start with a TeachingTip sytle one for now
image

Unless we could somehow pre-render a web page to an image and display that in the tooltip. Or use something like the "social" image from github (though I haven't the damndest clue how that works.)

Maybe we should just start with

Open [web page | file]: 
{url}

in the tooltip

@zadjii-msft commented on GitHub (Aug 21, 2020): Hey so hover tooltip might be hard - we can't embed a webview, so doing something like ![image](https://user-images.githubusercontent.com/18356694/90826230-ba65e800-e2ff-11ea-9126-446162797dc0.png) Might be _especially_ hard. But we could start with a `TeachingTip` sytle one for now ![image](https://user-images.githubusercontent.com/18356694/90826280-cb165e00-e2ff-11ea-88f6-5123d7dfb283.png) Unless we could somehow pre-render a web page to an image and display that in the tooltip. Or use something like the "social" image from github (though I haven't the damndest clue how that works.) Maybe we should just start with ``` Open [web page | file]: {url} ``` in the tooltip
Author
Owner

@DHowett commented on GitHub (Aug 21, 2020):

Yeah i definitely think tooltip and “the link preview from the video” are different workitems that we should tackle separately :)

@DHowett commented on GitHub (Aug 21, 2020): Yeah i definitely think _tooltip_ and “the link preview from the video” are different workitems that we should tackle separately :)
Author
Owner

@j4james commented on GitHub (Aug 23, 2020):

If you have to have a "link preview", I'd recommend something really basic based on the page meta data (like the meta title and description, and maybe a favicon and/or og:image). But as cool as this might seem, I don't think it's practical for a hover effect given the delay needed to download and render these things (unless you're pre-rendering the previews, which sounds like a really bad idea).

Which brings me to the main problem. Even if you're only connecting to the site on hover, that still seems inadvisable. When I'm using a terminal I really wouldn't expect it to be making internet connections without my consent. So this feature would definitely have to be optional, and arguably I think should be off by default.

I'm possibly a little biased here, because my internet connection is metered to a certain extent. But even if that weren't the case, would most people be comfortable with their terminal downloading unknown webpages in the background?

@j4james commented on GitHub (Aug 23, 2020): If you have to have a "link preview", I'd recommend something really basic based on the page meta data (like the meta title and description, and maybe a favicon and/or og:image). But as cool as this might seem, I don't think it's practical for a hover effect given the delay needed to download and render these things (unless you're pre-rendering the previews, which sounds like a really bad idea). Which brings me to the main problem. Even if you're only connecting to the site on hover, that still seems inadvisable. When I'm using a terminal I really wouldn't expect it to be making internet connections without my consent. So this feature would definitely have to be optional, and arguably I think should be off by default. I'm possibly a little biased here, because my internet connection is metered to a certain extent. But even if that weren't the case, would most people be comfortable with their terminal downloading unknown webpages in the background?
Author
Owner

@DHowett commented on GitHub (Aug 23, 2020):

Yeah, I definitely don't think that "fetch any link I hover over" is something we should ship in core or opt-in by default. It makes for a really compelling video because it shows how modern and flashy we are, but it's too much of a disclosure and safety risk to put right into our project.

@DHowett commented on GitHub (Aug 23, 2020): Yeah, I definitely don't think that "fetch any link I hover over" is something we should ship in core or opt-in by default. It makes for a really compelling video because it shows how modern and flashy we are, but it's too much of a disclosure and safety risk to put right into our project.
Author
Owner

@jzabroski commented on GitHub (Sep 3, 2020):

  • Allow mailto: URIs

Would this be RFC conforming 😒 mailto: URL, or 😍 mailto: URL that allows multiple email addresses?

@jzabroski commented on GitHub (Sep 3, 2020): > * Allow `mailto:` URIs Would this be RFC conforming 😒 `mailto:` URL, or 😍 `mailto:` URL that allows multiple email addresses?
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

Generally, "whatever type of thing is supported by the registered protocol handler" ;P

@DHowett commented on GitHub (Sep 3, 2020): Generally, "whatever type of thing is supported by the registered protocol handler" ;P
Author
Owner

@jantari commented on GitHub (Sep 3, 2020):

I don't know whether this has been considered already, but when doing a rich-text copy of the terminal buffer the hyperlinks should probably be preserved on paste

@jantari commented on GitHub (Sep 3, 2020): I don't know whether this has been considered already, but when doing a rich-text copy of the terminal buffer the hyperlinks should probably be preserved on paste
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

Thanks @jantari! Just added that to the main scenario body.

@DHowett commented on GitHub (Sep 3, 2020): Thanks @jantari! Just added that to the main scenario body.
Author
Owner

@giggio commented on GitHub (Sep 3, 2020):

I just built the latest commit, but it can't parse an url, you have to use the escape sequences. Is this use case planned:

echo 'Hello from Windows Terminal: https://github.com/microsoft/terminal/'

And then click on the link and it opens?

@giggio commented on GitHub (Sep 3, 2020): I just built the latest commit, but it can't parse an url, you have to use the escape sequences. Is this use case planned: ````bash echo 'Hello from Windows Terminal: https://github.com/microsoft/terminal/' ```` And then click on the link and it opens?
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

@giggio er..
image

image

image

@DHowett commented on GitHub (Sep 3, 2020): @giggio er.. ![image](https://user-images.githubusercontent.com/189190/92176831-206c6800-edf4-11ea-8e37-b9f878932035.png) ![image](https://user-images.githubusercontent.com/189190/92176845-28c4a300-edf4-11ea-9c94-85ce9c0b5228.png) ![image](https://user-images.githubusercontent.com/189190/92176852-2e21ed80-edf4-11ea-94c0-3c14fd389a9c.png)
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

I don't just say these things for fun 😉 (edit: this was intended to be read as "funny", not "wow Dustin's a jerk" (but I get it!))

@DHowett commented on GitHub (Sep 3, 2020): I don't just say these things for fun 😉 (edit: this was intended to be read as "funny", not "wow Dustin's a jerk" (but I get it!))
Author
Owner

@giggio commented on GitHub (Sep 3, 2020):

I had seen that comment, I was just not sure that this is what it meant, thanks for the clarification, Dustin!
And good thing you explained, so I could see it as funny. ;)

So, if I understand correctly, we don't have yet an issue tracking this item (auto-detection) specifically?

@giggio commented on GitHub (Sep 3, 2020): I had seen that comment, I was just not sure that this is what it meant, thanks for the clarification, Dustin! And good thing you explained, so I could see it as funny. ;) So, if I understand correctly, we don't have yet an issue tracking this item (auto-detection) specifically?
Author
Owner

@DHowett commented on GitHub (Sep 3, 2020):

@giggio There's a lot of discussion about how to do autodetection in the comments on https://github.com/microsoft/terminal/issues/574 😄 so we're somewhat treating that issue as canonical.

@DHowett commented on GitHub (Sep 3, 2020): @giggio There's a lot of discussion about how to do autodetection in the comments on https://github.com/microsoft/terminal/issues/574 :smile: so we're somewhat treating that issue as canonical.
Author
Owner

@simonratner commented on GitHub (Nov 11, 2020):

Question about url detection in 1.5.3142.

Works great in the terminal, but not inside vi. Is the app doing something special to disable this, or a different mode that url detection does not work with? I was really hoping to be able to Ctrl-Click all those documentation links in code comments.

image
image

@simonratner commented on GitHub (Nov 11, 2020): Question about url detection in 1.5.3142. Works great in the terminal, but not inside vi. Is the app doing something special to disable this, or a different mode that url detection does not work with? I was really hoping to be able to Ctrl-Click all those documentation links in code comments. ![image](https://user-images.githubusercontent.com/667283/98875547-4a17c000-2431-11eb-8b36-9bde906f6388.png) ![image](https://user-images.githubusercontent.com/667283/98875848-e346d680-2431-11eb-9e57-a39db5feea43.png)
Author
Owner

@DHowett commented on GitHub (Nov 11, 2020):

So, Vim (if that's your vi implementation of choice) enables "mouse mode" -- it lets you select text and navigate the document with your mouse. You can either turn off mouse mode (:set mouse=) or temporarily suppress it by holding down Shift.

(This is also the reason that you cannot select text using the terminal when Vim is running.)

@DHowett commented on GitHub (Nov 11, 2020): So, Vim (if that's your vi implementation of choice) enables "mouse mode" -- it lets you select text and navigate the document with your mouse. You can either turn off mouse mode (`:set mouse=`) or temporarily suppress it by holding down Shift. (This is also the reason that you cannot select text _using the terminal_ when Vim is running.)
Author
Owner

@jantari commented on GitHub (Nov 12, 2020):

Thanks for the information, "mouse mode" was not turned on by default for me in:

  • WSL, Ubuntu 20.04 where I tested vim 8.1
  • Windows, where I use neovim v0.5.0-558-g6d1404faf

and links worked OOTB, but I could enable it on either with :set mouse=a and not only did it exhibit the behavior you described but I also learned about mouse-mode today, thanks!

@jantari commented on GitHub (Nov 12, 2020): Thanks for the information, "mouse mode" was not turned on by default for me in: - WSL, Ubuntu 20.04 where I tested vim 8.1 - Windows, where I use neovim v0.5.0-558-g6d1404faf and links worked OOTB, but I could enable it on either with `:set mouse=a` and not only did it exhibit the behavior you described but I also learned about mouse-mode today, thanks!
Author
Owner

@abhijit-hota commented on GitHub (Dec 7, 2020):

There's no solid way to detect the version of the Windows Terminal (and this feature) by an application as of now. One more use case to support #1040 .

One way is to trigger wt -v as wt is available in the Path but the again, it shows up an alert rather than just printing it. (Any reasons it does that?)

@abhijit-hota commented on GitHub (Dec 7, 2020): There's no solid way to detect the version of the Windows Terminal (and this feature) by an application as of now. One more use case to support #1040 . One way is to trigger `wt -v` as `wt` is available in the Path but the again, it shows up an alert rather than just printing it. (Any reasons it does that?)
Author
Owner

@DHowett commented on GitHub (Dec 7, 2020):

any reasons

About a hundred. The rationale for this spec explains why. https://github.com/microsoft/terminal/blob/dev/duhowett/spec/console-allocation/doc/specs/%237335%20-%20Console%20Allocation%20Policy.md#abstract

@DHowett commented on GitHub (Dec 7, 2020): > any reasons About a hundred. The rationale for this spec explains why. https://github.com/microsoft/terminal/blob/dev/duhowett/spec/console-allocation/doc/specs/%237335%20-%20Console%20Allocation%20Policy.md#abstract
Author
Owner

@abhijit-hota commented on GitHub (Dec 7, 2020):

About a hundred. The rationale for this spec explains why. https://github.com/microsoft/terminal/blob/dev/duhowett/spec/console-allocation/doc/specs/%237335%20-%20Console%20Allocation%20Policy.md#abstract

Ah I see. Thanks for the clarification. Waiting for 1040 to get resolved :).

Edit: I don't understand the abstract but I get there are valid reasons.

@abhijit-hota commented on GitHub (Dec 7, 2020): > About a hundred. The rationale for this spec explains why. https://github.com/microsoft/terminal/blob/dev/duhowett/spec/console-allocation/doc/specs/%237335%20-%20Console%20Allocation%20Policy.md#abstract Ah I see. Thanks for the clarification. Waiting for 1040 to get resolved :). Edit: I don't understand the abstract but I get there are valid reasons.
Author
Owner

@GoodClover commented on GitHub (Jan 10, 2021):

I was wondering if there was any plans to support data: URIs?
This could be used to embed a (very small) image or just some plain text that would appear, most likely in a popup.

I saw #6747, which suggest support for parsing them is planned for settings.json icons.

There is some info about data: in terminals here: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#gistcomment-2192652

@GoodClover commented on GitHub (Jan 10, 2021): I was wondering if there was any plans to support [`data:` URIs](https://en.wikipedia.org/wiki/Data_URI_scheme)? This could be used to embed a (very small) image or just some plain text that would appear, most likely in a popup. I saw #6747, which suggest support for parsing them is planned for `settings.json` icons. There is some info about `data:` in terminals here: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#gistcomment-2192652
Author
Owner

@wongjn commented on GitHub (Jan 28, 2021):

Is there a way to change to modifier key for a link press? I have grown accustomed to using ALT. I couldn't find anything in the documentation, so it would be nice to have this as a keybind setting if it does not exist already.

@wongjn commented on GitHub (Jan 28, 2021): Is there a way to change to modifier key for a link press? I have grown accustomed to using `ALT`. I couldn't find anything in the documentation, so it would be nice to have this as a keybind setting if it does not exist already.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Jan 29, 2021):

Is there a way to change to modifier key for a link press?

No, the Ctrl+click combination is hardcoded here:

https://github.com/microsoft/terminal/blob/9c4950cb32a06b3ba448d10371c7f6977d9d0090/src/cascadia/TerminalControl/TermControl.cpp#L1284-L1288
https://github.com/microsoft/terminal/blob/b140299e501e961f09226eba7e023db9b7cdb393/src/cascadia/TerminalControl/Resources/en-US/Resources.resw#L178-L180

If https://github.com/microsoft/terminal/issues/1553 were implemented, then users would be able to change the modifier, I think.

@KalleOlaviNiemitalo commented on GitHub (Jan 29, 2021): > Is there a way to change to modifier key for a link press? No, the Ctrl+click combination is hardcoded here: <https://github.com/microsoft/terminal/blob/9c4950cb32a06b3ba448d10371c7f6977d9d0090/src/cascadia/TerminalControl/TermControl.cpp#L1284-L1288> <https://github.com/microsoft/terminal/blob/b140299e501e961f09226eba7e023db9b7cdb393/src/cascadia/TerminalControl/Resources/en-US/Resources.resw#L178-L180> If <https://github.com/microsoft/terminal/issues/1553> were implemented, then users would be able to change the modifier, I think.
Author
Owner

@vtjeng commented on GitHub (Feb 5, 2021):

I have Windows Terminal 1.5.10271.0 installed, and it looks like Ctrl+Click on http://127.0.0.1:5000 actually already works (which is amazing!) - which release was this made available in? (https://github.com/microsoft/terminal/releases does not seem to contain anything specific about this). Sorry if this is the wrong issue.

image

[1] I know that it is in Windows Terminal Preview v1.5.3142.0 but it doesn't seem to be in the regular Winodws Terminal release notes.

@vtjeng commented on GitHub (Feb 5, 2021): I have `Windows Terminal 1.5.10271.0` installed, and it looks like Ctrl+Click on `http://127.0.0.1:5000` actually already works (which is amazing!) - which release was this made available in? (https://github.com/microsoft/terminal/releases does not seem to contain anything specific about this). Sorry if this is the wrong issue. ![image](https://user-images.githubusercontent.com/5932817/107078302-fbb15d80-67a2-11eb-9cb1-467cfb17280d.png) [1] I know that it is in [`Windows Terminal Preview v1.5.3142.0`](https://github.com/microsoft/terminal/pull/7691#issuecomment-725580515) but it doesn't seem to be in the regular `Winodws Terminal` release notes.
Author
Owner

@DHowett commented on GitHub (Feb 5, 2021):

This came out in 1.5!

image

@DHowett commented on GitHub (Feb 5, 2021): This came out in 1.5! ![image](https://user-images.githubusercontent.com/189190/107078664-7a0dff80-67a3-11eb-9907-5556bbadaa9a.png)
Author
Owner

@vefatica commented on GitHub (Mar 11, 2021):

ftp:// ... I get underlining and a popup "Ctrl+click" tip but can't follow it.

mailto:// ... nothing.

What's the plan? Thanks.

@vefatica commented on GitHub (Mar 11, 2021): ftp:// ... I get underlining and a popup "Ctrl+click" tip but can't follow it. mailto:// ... nothing. What's the plan? Thanks.
Author
Owner

@DHowett commented on GitHub (Mar 11, 2021):

to be fair, mailto isn’t traditionally followed by // as it does not designate a path. We have issues tracking both “let me customize the URL regex” and “expand protocol support.”

So that’s the plan.

@DHowett commented on GitHub (Mar 11, 2021): to be fair, mailto isn’t traditionally followed by `//` as it does not designate a path. We have issues tracking both “let me customize the URL regex” and “expand protocol support.” So that’s the plan.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Mar 11, 2021):

@vefatica, in v1.7.572.0, TerminalPage::_IsUriSupported allows only http, https, and file. Other URI schemes have been discussed in https://github.com/microsoft/terminal/issues/7562.

@KalleOlaviNiemitalo commented on GitHub (Mar 11, 2021): @vefatica, in v1.7.572.0, [TerminalPage::_IsUriSupported](https://github.com/microsoft/terminal/blob/89c9e6db847ed7f262d1f5a7f972ef004320ff6e/src/cascadia/TerminalApp/TerminalPage.cpp#L2213-L2242) allows only `http`, `https`, and `file`. Other URI schemes have been discussed in <https://github.com/microsoft/terminal/issues/7562>.
Author
Owner

@vefatica commented on GitHub (Mar 11, 2021):

What about ftp://? ... not supported? Yet it gets underlined and a popup tip.

I can't remember way back but in recent decades I've always used mailto://. ShellExecuteEx doesn't mind

@vefatica commented on GitHub (Mar 11, 2021): What about ftp://? ... not supported? Yet it gets underlined and a popup tip. I can't remember way back but in recent decades I've always used mailto://. ShellExecuteEx doesn't mind
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Mar 11, 2021):

According to https://github.com/microsoft/terminal/pull/7691#discussion_r513595391, ftp: hyperlinks were going to be unblocked "shortly"; but almost five months have passed already. The regex in v1.7.572.0: https://github.com/microsoft/terminal/blob/89c9e6db847ed7f262d1f5a7f972ef004320ff6e/src/cascadia/TerminalCore/Terminal.cpp#L87

@KalleOlaviNiemitalo commented on GitHub (Mar 11, 2021): According to <https://github.com/microsoft/terminal/pull/7691#discussion_r513595391>, `ftp:` hyperlinks were going to be unblocked "shortly"; but almost five months have passed already. The regex in v1.7.572.0: <https://github.com/microsoft/terminal/blob/89c9e6db847ed7f262d1f5a7f972ef004320ff6e/src/cascadia/TerminalCore/Terminal.cpp#L87>
Author
Owner

@heaths commented on GitHub (May 25, 2021):

file:// links with \\wsl$ yield an error dialog despite working as-is from the Windows Run dialog. I opened #10188 to track, unless you wanted to keep this issue as an evergreen source of outstanding issues.

@heaths commented on GitHub (May 25, 2021): `file://` links with `\\wsl$` yield an error dialog despite working as-is from the Windows Run dialog. I opened #10188 to track, unless you wanted to keep this issue as an evergreen source of outstanding issues.
Author
Owner

@phil-blain commented on GitHub (Sep 24, 2021):

Hi! I'd like to be able to configure the web browser used to open hyperlinks, but just for Windows Terminal (not OS-wide). I couldn't find an open issue about that, should I open a feature request ? :) Thanks for working on such a nice app!

@phil-blain commented on GitHub (Sep 24, 2021): Hi! I'd like to be able to configure the web browser used to open hyperlinks, but just for Windows Terminal (not OS-wide). I couldn't find an open issue about that, should I open a feature request ? :) Thanks for working on such a nice app!
Author
Owner

@zadjii-msft commented on GitHub (Sep 24, 2021):

@phil-blain From #9491

I'd rather not get us into the business of launching specific applications for URLs specifically. Once we add configurable pattern detection and matching (which is on the backlog somewhere), we'll also add pattern execution. That'll let folks customize which browser launches for which patterns.

see #8849

@zadjii-msft commented on GitHub (Sep 24, 2021): @phil-blain From #9491 > I'd rather not get us into the business of launching specific applications for _URLs specifically_. Once we add configurable pattern detection and matching (which is on the backlog somewhere), we'll also add pattern _execution_. That'll let folks customize which browser launches for which patterns. > > see #8849
Author
Owner

@ironyman commented on GitHub (Aug 28, 2022):

@zadjii-msft
Just wondering, how hard would it be to let console applications emit hyperlinked text? E.g. if dir could output hyperlinked file names which are clickable and launches the files that would be pretty cool. Like the Symbolics Genera terminals https://www.youtube.com/watch?v=o4-YnLpLgtk

@ironyman commented on GitHub (Aug 28, 2022): @zadjii-msft Just wondering, how hard would it be to let console applications emit hyperlinked text? E.g. if dir could output hyperlinked file names which are clickable and launches the files that would be pretty cool. Like the Symbolics Genera terminals https://www.youtube.com/watch?v=o4-YnLpLgtk
Author
Owner

@lucy commented on GitHub (Aug 28, 2022):

@ironyman
You can already do this with OSC 8 (https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) which Windows Terminal supports AFAIK.

@lucy commented on GitHub (Aug 28, 2022): @ironyman You can already do this with OSC 8 (<https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda>) which Windows Terminal supports AFAIK.
Author
Owner

@zadjii-msft commented on GitHub (Aug 29, 2022):

So yes and no. Apps can print hyperlinks, for sure, easily today with OSC8 as mentioned above. Now, there's definitely limitations here. The OSC8 spec specifically calls out files in this section, though, I don't think we support file:// URIs quite yet. There's complicated reasons for that, which are probably mentioned in # NEVERMIND I was wrong. See #7526. Neato!

Then there's always the issue of updating the utilities to make use of that sequence. Updating the dir in cmd is pretty much off the table, but PowerShell's gci might have more luck.

@zadjii-msft commented on GitHub (Aug 29, 2022): So yes and no. Apps can print hyperlinks, for sure, easily today with OSC8 as mentioned above. Now, there's definitely limitations here. The OSC8 spec specifically calls out files in [this section](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#file-uris-and-the-hostname), ~though, I don't think we support `file://` URIs quite yet. There's complicated reasons for that, which are probably mentioned in #~ NEVERMIND I was wrong. See #7526. Neato! Then there's always the issue of updating the utilities to make use of that sequence. Updating the `dir` in `cmd` is [pretty much off the table](https://github.com/microsoft/terminal/blob/main/doc/Niksa.md#why-do-we-avoid-changing-cmdexe), but PowerShell's `gci` might have more luck.
Author
Owner

@heaths commented on GitHub (Aug 29, 2022):

I don't think we support file:// URIs quite yet. There's complicated reasons for that, which are probably mentioned in # NEVERMIND I was wrong. See #7526. Neato!

Though, #10188 still means they don't work for WSL URIs. 😉

@heaths commented on GitHub (Aug 29, 2022): > ~I don't think we support `file://` URIs quite yet. There's complicated reasons for that, which are probably mentioned in #~ NEVERMIND I was wrong. See #7526. Neato! Though, #10188 still means they don't work for WSL URIs. 😉
Author
Owner

@ironyman commented on GitHub (Sep 14, 2022):

Thank you @lucy I didn't know that command existed. That addresses one issue!

@zadjii-msft clickable sendInput is a really good idea. I imagine it would be very useful after say running git branch, then you could click on one of the branches and terminal would fill the input prompt with git checkout (branch name). That would be super cool.

Although what if you don't want to checkout but rather you want to delete the branch? Is there an easy way to give the user a list of options?

@ironyman commented on GitHub (Sep 14, 2022): Thank you @lucy I didn't know that command existed. That addresses one issue! @zadjii-msft clickable sendInput is a really good idea. I imagine it would be very useful after say running `git branch`, then you could click on one of the branches and terminal would fill the input prompt with `git checkout (branch name)`. That would be super cool. Although what if you don't want to checkout but rather you want to delete the branch? Is there an easy way to give the user a list of options?
Author
Owner

@zadjii-msft commented on GitHub (Sep 14, 2022):

@ironyman That's definitely an interesting idea. We're absolutely in the realm of hypotheticals now. Click-to-sendInput isn't an existing paradigm, so I suppose we can come up with whatever we want. What would that UX be like?

Would it be something like:
image>


Since I'm keeping notes here:

clickable sendInput

ee8082050e

dev/migrie/fhl-clickable-send-input

@zadjii-msft commented on GitHub (Sep 14, 2022): @ironyman That's definitely an interesting idea. We're absolutely in the realm of hypotheticals now. Click-to-sendInput isn't an existing paradigm, so I suppose we can come up with whatever we want. What would that UX be like? Would it be something like: ![image](https://user-images.githubusercontent.com/18356694/190130441-cd7bb082-7229-4805-997e-726a43926491.png)> ----- Since I'm keeping notes here: clickable sendInput ee8082050ecdcc2fde5850e86e1cdcdd74a4cc60 `dev/migrie/fhl-clickable-send-input`
Author
Owner

@jantari commented on GitHub (Sep 14, 2022):

I think the particular scenario you're discussing (suggesting branch names) is better served by tab-completion.

But, for other scenarios or if mouse-interaction is really really wanted then console-apps can already receive and process mouse input (see INPUT_RECORD struct). I feel like it is best left to application developers to create either git-clients or tab-completion engines that implement mouse-support application-side. I don't think it is something the terminal needs to get (even more) involved in, unless there is a recognized VT standard for it we don't support but I haven't heard of any.

@jantari commented on GitHub (Sep 14, 2022): I think the particular scenario you're discussing (suggesting branch names) is better served by tab-completion. But, for other scenarios or if mouse-interaction is really really wanted then console-apps can already receive and process mouse input (see [INPUT_RECORD struct](https://docs.microsoft.com/en-us/windows/console/input-record-str)). I feel like it is best left to application developers to create either git-clients or tab-completion engines that implement mouse-support application-side. I don't think it is something the terminal needs to get (even more) involved in, unless there is a recognized VT standard for it we don't support but I haven't heard of any.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Sep 14, 2022):

Click-to-sendInput seems rather error-prone because the software that outputs the clickable text does not know which software will eventually read the input, or what else will already be in the input buffer.

Alternatively, clicking the text could copy an application-specified string to the clipboard (or display a menu of such strings), and the user could then separately paste it where desired (respecting the bracketed paste mode). This would not allow the string to contain function-key events or similar.

Alternatively, clicking the text could send a Windows Terminal specific event with an application-defined (Base64?) payload, and the receiving application could then decide whether to run it as a command or insert as text. This however would require changes in shells in order to handle such events.

@KalleOlaviNiemitalo commented on GitHub (Sep 14, 2022): Click-to-sendInput seems rather error-prone because the software that outputs the clickable text does not know which software will eventually read the input, or what else will already be in the input buffer. Alternatively, clicking the text could copy an application-specified string to the clipboard (or display a menu of such strings), and the user could then separately paste it where desired (respecting the bracketed paste mode). This would not allow the string to contain function-key events or similar. Alternatively, clicking the text could send a Windows Terminal specific event with an application-defined (Base64?) payload, and the receiving application could then decide whether to run it as a command or insert as text. This however would require changes in shells in order to handle such events.
Author
Owner

@KindDragon commented on GitHub (Sep 14, 2022):

Would it be something like: image

Looks similar to https://fig.io. I would love to see it on Windows

@KindDragon commented on GitHub (Sep 14, 2022): > Would it be something like: ![image](https://user-images.githubusercontent.com/18356694/190130441-cd7bb082-7229-4805-997e-726a43926491.png) Looks similar to https://fig.io. I would love to see it on Windows
Author
Owner

@ironyman commented on GitHub (Sep 15, 2022):

I think the particular scenario you're discussing (suggesting branch names) is better served by tab-completion.

But, for other scenarios or if mouse-interaction is really really wanted then console-apps can already receive and process mouse input (see INPUT_RECORD struct). I feel like it is best left to application developers to create either git-clients or tab-completion engines that implement mouse-support application-side. I don't think it is something the terminal needs to get (even more) involved in, unless there is a recognized VT standard for it we don't support but I haven't heard of any.

I think tab completion is good for people that already know what commands they want to use but for beginners it would be helpful to have the relevant commands presented to them when the context appears.

It's also more convenient to click on a menu item even if you could type it sometimes because it's faster. If you're familiar with windbg, it has a CLI environment where some commands output clickable text that executes commands in appropriate situations.

Regarding your second point, I think it's hard to leave everything to app developer and the terminal has to help out here because in git, it will print something and exit so it can't handle clicks. That means you need a git-client of some sort but that's a lot of work. It's much easier to let git output clickable text that fills the terminal's input prompt for the next git command.

@zadjii-msft I think that would be perfect!

@ironyman commented on GitHub (Sep 15, 2022): > I think the particular scenario you're discussing (suggesting branch names) is better served by tab-completion. > > But, for other scenarios or if mouse-interaction is really really wanted then console-apps can already receive and process mouse input (see [INPUT_RECORD struct](https://docs.microsoft.com/en-us/windows/console/input-record-str)). I feel like it is best left to application developers to create either git-clients or tab-completion engines that implement mouse-support application-side. I don't think it is something the terminal needs to get (even more) involved in, unless there is a recognized VT standard for it we don't support but I haven't heard of any. I think tab completion is good for people that already know what commands they want to use but for beginners it would be helpful to have the relevant commands presented to them when the context appears. It's also more convenient to click on a menu item even if you could type it sometimes because it's faster. If you're familiar with windbg, it has a CLI environment where some commands output clickable text that executes commands in appropriate situations. Regarding your second point, I think it's hard to leave everything to app developer and the terminal has to help out here because in git, it will print something and exit so it can't handle clicks. That means you need a git-client of some sort but that's a lot of work. It's much easier to let git output clickable text that fills the terminal's input prompt for the next git command. @zadjii-msft I think that would be perfect!
Author
Owner

@SeeminglyScience commented on GitHub (Sep 15, 2022):

WinDbg's console is a good showcase of how useful "click to send input" could be.

image

In the screenshot the first command was typed manually. The second command was processed automatically by clicking the second link (next to MethodTable). I think PowerShell (and probably everything else really) could use this type of feature extensively in object formatting to greatly improve workflow, especially for newer folks.

@SeeminglyScience commented on GitHub (Sep 15, 2022): `WinDbg`'s console is a good showcase of how useful "click to send input" could be. ![image](https://user-images.githubusercontent.com/24977523/190490331-b1a2460e-9971-49cc-95dc-2e35489b4a25.png) In the screenshot the first command was typed manually. The second command was processed automatically by clicking the second link (next to `MethodTable`). I think PowerShell (and probably everything else really) could use this type of feature extensively in object formatting to greatly improve workflow, especially for newer folks.
Author
Owner

@KalleOlaviNiemitalo commented on GitHub (Sep 17, 2022):

The security needs of the debugger are different because the extensions that output DML are loaded and trusted by the debugger engine.

For the PowerShell scenario, if WT sent a custom event, then PSReadLine could recognise that. It would work as well as allowing arbitrary sendinput, perhaps even better because the event handler could stash the line that is being edited and restore it afterwards.

@KalleOlaviNiemitalo commented on GitHub (Sep 17, 2022): The security needs of the debugger are different because the extensions that output DML are loaded and trusted by the debugger engine. For the PowerShell scenario, if WT sent a custom event, then PSReadLine could recognise that. It would work as well as allowing arbitrary sendinput, perhaps even better because the event handler could stash the line that is being edited and restore it afterwards.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#6974