Skip to content
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

URL hover doesn't work when VT mouse mode is enabled #9117

Closed
Tracked by #5001
ondras opened this issue Feb 11, 2021 · 14 comments
Closed
Tracked by #5001

URL hover doesn't work when VT mouse mode is enabled #9117

ondras opened this issue Feb 11, 2021 · 14 comments
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@ondras
Copy link

ondras commented Feb 11, 2021

Environment

Windows build number:  [Version 10.0.19042.804]
Windows Terminal version (if applicable): 1.5.10271.0

URLs are not underlined (nor clickable) when displayed in a tmux session (in a Windows Terminal window). They work fine when displayed without tmux.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Feb 11, 2021
@zadjii-msft
Copy link
Member

Are you using mouse mode with tmux? If so, you'll probably need to hold Shift to make the hyperlinks work. When an app has requested mouse mode, the app gets the first shot at mouse detection.

This isn't strictly consistent with other terminals though. gnome-terminal will still highlight hyperlinks, even when an app is in mouse mode. @DHowett do we have a dupe for this?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Feb 11, 2021
@ondras
Copy link
Author

ondras commented Feb 11, 2021

Are you using mouse mode with tmux? If so, you'll probably need to hold Shift to make the hyperlinks work. When an app has requested mouse mode, the app gets the first shot at mouse detection.

Yeah, that is the case. Thanks for suggesting the Shift workaround. It would be nice to be on par with other terminal apps (xfce-terminal in my case), though, to provide consistent cross-platform behavior/UX.

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Feb 11, 2021
@zadjii-msft zadjii-msft added Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Feb 12, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Feb 12, 2021
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Feb 12, 2021
@DHowett
Copy link
Member

DHowett commented Feb 23, 2021

Don't think we have a dupe, but I'll title this one appropriately.

@DHowett DHowett changed the title url detection not working with tmux URL hover doesn't work when VT mouse mode is enabled Feb 23, 2021
@DHowett
Copy link
Member

DHowett commented Feb 23, 2021

Here's what I think we should do. When VT mouse mode is on, hover should work fine ... but the tooltip should say "ctrl+shift+click" instead of "ctrl+click". What do you think?

@DHowett DHowett removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. labels Feb 23, 2021
@ondras
Copy link
Author

ondras commented Feb 23, 2021

gnome-terminal will still highlight hyperlinks, even when an app is in mouse mode.

My xfce4-terminal will still ctrl-click hyperlinks, even when an app is in mouse mode. What is preventing Windows Terminal from working the same?

@DHowett
Copy link
Member

DHowett commented Feb 23, 2021

@ondras because we didn’t implement it like that? And you reported it to us, in this bug that you reported, and we accepted into our backlog to fix? ???

@ondras
Copy link
Author

ondras commented Feb 23, 2021

@ondras because we didn’t implement it like that? And you reported it to us, in this bug that you reported, and we accepted into our backlog to fix? ???

So it might be misunderstanding on my side. Because after reading this comment of yours,

the tooltip should say "ctrl+shift+click" instead of "ctrl+click".

it seemed to me that you are suggesting to leave in the current "ctrl+shift+click" implementation (and change the tooltip accordingly), instead of changing the behavior to "ctrl+click" (and leaving the tooltip in its current state).

Sorry for causing confusion.

@DHowett
Copy link
Member

DHowett commented Feb 23, 2021

Oh, yes, sorry. I was confused. I was wondering if we should maintain the shift behavior for user consistency with VT mouse applications 😄

@Don-Vito
Copy link
Contributor

Don-Vito commented Mar 5, 2021

@DHowett , @ondras - probably this is a stupid question, but in the suggested solution, should ctrl+click only handle the hyperlink or also send the input to VT?

@ghost ghost added the In-PR This issue has a related PR label Mar 5, 2021
@j4james
Copy link
Collaborator

j4james commented Mar 5, 2021

I would think if an app has enabled mouse mode, then we probably shouldn't be intercepting clicks on links, unless we're talking about OSC 8 hyperlinks that the app has specifically indicated are meant to be handled by the terminal. For example, if the app is something like a web browser, I wouldn't think it would want the terminal taking over links in the web pages it is showing.

I've just been looking at how Mintty handles this, and they have options to let the user decide how it should work, but by default it seems that clicks are passed through to the app, unless you override with Shift (so you need Ctrl-Shift-Click to intercept a link click).

image

@Don-Vito
Copy link
Contributor

Don-Vito commented Mar 5, 2021

I would think if an app has enabled mouse mode, then we probably shouldn't be intercepting clicks on links, unless we're talking about OSC 8 hyperlinks that the app has specifically indicated are meant to be handled by the terminal. For example, if the app is something like a web browser, I wouldn't think it would want the terminal taking over links in the web pages it is showing.

I've just been looking at how Mintty handles this, and they have options to let the user decide how it should work, but by default it seems that clicks are passed through to the app, unless you override with Shift (so you need Ctrl-Shift-Click to intercept a link click).

image

Yeah. I like this direction. It also requires minimal change in code 😄
Major concern is that the user might be not aware that the app is in mouse mode.. and will expect that ctrl+click will work.

@j4james
Copy link
Collaborator

j4james commented Mar 6, 2021

Major concern is that the user might be not aware that the app is in mouse mode.. and will expect that ctrl+click will work.

Is it too late to make Ctrl+Shift+Click the key combo to use for all auto-detected links? Then the user doesn't need to know whether the app is in mouse mode or not, but we also aren't hijacking one of the main click types.

Otherwise maybe there needs to be a mode that apps can set to enable or disable this functionality. It's possible some other terminals already have something like that actually.

@ghost ghost removed the In-PR This issue has a related PR label Mar 10, 2021
@ghost ghost closed this as completed in 6cd4e03 Mar 10, 2021
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Mar 10, 2021
DHowett pushed a commit that referenced this issue Mar 15, 2021
## PR Checklist
* [x] Closes #9117
* [x] CLA signed.
* [x] Tests added/passed
* [ ] Documentation updated.
* [ ] Schema updated.
* [x] I've discussed this with core contributors already.

## Detailed Description of the Pull Request / Additional comments
In mouse mode:
* Underline hyperlinks
* Activate hyperlink on ctrl+click rather than sending input to VT

(cherry picked from commit 6cd4e03)
DHowett pushed a commit that referenced this issue Mar 15, 2021
## PR Checklist
* [x] Closes #9117
* [x] CLA signed.
* [x] Tests added/passed
* [ ] Documentation updated.
* [ ] Schema updated.
* [x] I've discussed this with core contributors already.

## Detailed Description of the Pull Request / Additional comments
In mouse mode:
* Underline hyperlinks
* Activate hyperlink on ctrl+click rather than sending input to VT

(cherry picked from commit 6cd4e03)
@ghost
Copy link

ghost commented Apr 14, 2021

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

Handy links:

@ghost
Copy link

ghost commented Apr 14, 2021

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

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

5 participants