-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
OSC 8 support for conhost and terminal #7251
Conversation
Just a wee note for the interested - in powershell core (pwsh) you can use the escape code |
Chatted with Pankaj over Teams about a design change:
|
Updates notes from plan chat: We're going to not render hyperlinks right now. We don't want to damage their attributes, and we can render them better when we do it right. We had a discussion about how to support IDs provided by applications as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'm very happy with this. I have a couple bigger concerns, but I think this is pretty darn close.
- The more times I saw
AddHyperlink
being used for both starting and stopping hyperlink attributes, the more I thought it needed to be two separate methods. - Should we convert the
std::wstring params
we're parsing from the VT sequence to astd::unordered_map<std::wstring, std::wstring> params
, and pass that map of parameter k/v pairs around instead of just a raw string of params?- this might make it easier for us to get the
id
out of the params when we need it (even if the rest of the params would be ignored).
- this might make it easier for us to get the
- Does this work in the terminal if you emit
"^[]8;;https://github.com/microsoft/terminal^[\This is a link!"
, sleep for a second, then emit"^[]8;;^[\"
AND NOT a trailing newline? I'm guessing that conpty won't trigger a frame to complete the hyperlink sequence, but maybe it does just work?- I've very okay with this being a follow-up issue, if it does repro.
- Should we file a follow-up for highlighting/underlining URI's as we mouse over them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to clear my review because I'll be gone Friday/Monday.
@miniksa -- I'm going to defer to your opinion on ATTR_ROW gaining a GetHyperlinks
It looks like the bot merging pull requests breaks dependent branches. If you merge this manually, please copy the PR body into the actual commit message -- that's the only way to record it in immmutable history! 😄 |
Might be worth doing this. :) |
If it’s possible to have some kind of metadata attached to rows/chars, that would also help my potential sixel implementation, which, just like HyperLinks, also needs a way to store and render things on a character level. Thanks for the work @PankajBhojwani. Can’t wait to see this available. 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we're good. I'm sure something will come up that we'll have to fix, but looks pretty solid to me right now.
Awesome! When will this be released? |
Any time between an hour ago and an eternity from now 😄 Astute observers who have been following our monthly release cadence may consult their star charts to determine how far from now a month after our last release will be! |
Curious as to why are curly braces needed here?
|
They’re not. It’s throwaway test code to validate this PR, so it’s not trying to make a recommendation :) If it were to make a recommendation, that recommendation would be “move to powershell core where you can use `e”. |
🎉 Handy links: |
And what about support |
@insekticid Please open separate issue instead of commenting on this thread. |
@insekticid Thank you for the suggestion! Since this is regarding adding another URI scheme, please feel free to contribute to the discussion happening over at #7562 |
I'd like to use this ability to open an html file stored on a remote computer using the UNC path. I haven't been able to get it to open. Any ideas? Example: \\COMPUTER\UNC\Path\To\File.html |
Summary of the Pull Request
Conhost can now support OSC8 sequences (as specified here). Terminal also supports those sequences and additionally hyperlinks can be opened by Ctrl+LeftClicking on them.
References
#204
PR Checklist
Detailed Description of the Pull Request / Additional comments
Added support to:
Validation Steps Performed
Open up a PowerShell tab and type
Ctrl+LeftClick on the link correctly brings you to the terminal page on github