Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for autodetecting URLs and making hyperlinks #7691
Conversation
This comment has been minimized.
This comment has been minimized.
New misspellings found, please review:
To accept these changes, run the following commands
|
|
It doesn't look like this PR adds any custom logic to the UIA text range, so I doubt UIA clients will be able to detect clickable links with this implementation. Have you tested for this (i.e. with Narrator/NVDA)? As an aside, this PR makes a good case for allowing browse mode in terminals (nvaccess/nvda#11172). |
|
Regarding accessibility. I haven't had a chance to test this out yet. Especially since it's in draft. But here's some resources and an idea of the work we'll probably have to do (probably in a separate PR): In
Another thought. Hyperlink support is just for Windows Terminal, not ConHost, right? That'll complicate things a bit with our accessibility model because |
If this is the plan, might this be reconsidered? While Windows Terminal is very feature-filled, in my experience conhost has much wider usage. |
|
@codeofdusk, @carlos-zamora Hyperlink support is Terminal-FIRST, not Terminal-ONLY. Sorry for the confusion. Since we can move so much faster in Terminal it lets us figure out the interaction model a lot sooner than if we throw something together and hope that people jump on the Windows Insider builds and test our thing out. Many, many changes that make it into Terminal will eventually flow back. This is especially true for anything that deals with accessibility, standards compliance and text rendering. We'd like to figure out the interaction model for formatted text and browseable regions in Terminal before we bring anything like this back into conhost, absolutely. |
| const auto startRow = gsl::narrow<SHORT>(start / rowSize); | ||
| const auto startCol = gsl::narrow<SHORT>(start % rowSize); | ||
| const auto endRow = gsl::narrow<SHORT>(end / rowSize); | ||
| const auto endCol = gsl::narrow<SHORT>(end % rowSize); | ||
| const COORD startCoord{ startCol, startRow }; | ||
| const COORD endCoord{ endCol, endRow }; |
miniksa
Sep 25, 2020
Member
I am pretty sure this level of math is also done in Find/Selection and it might be using TIL or one of the utilities/types classes to help with it. Consider deduplicating with those.
I am pretty sure this level of math is also done in Find/Selection and it might be using TIL or one of the utilities/types classes to help with it. Consider deduplicating with those.
PankajBhojwani
Sep 28, 2020
•
Author
Contributor
Hm I can't seem to find the similar math - those parts of the code seem to begin with coordinates already (buffer or viewport) whereas here, since we only search after concatenating all the text together, we need to calculate the coordinates from the concatenated string
Hm I can't seem to find the similar math - those parts of the code seem to begin with coordinates already (buffer or viewport) whereas here, since we only search after concatenating all the text together, we need to calculate the coordinates from the concatenated string
|
Now I don't want to go too crazypants here, but I'm thinking about future extensions to some degree. I'm curious if you considered a design where the text buffer figures out the patterns on its own instead of being pumped to do that action by a thread from way outside itself, in this case from up in the Terminal* and friends. I'm not saying this one is bad or wrong, but an alternate vision I have is that you would register an object with the TextBuffer that contained a pattern, region of interest, and a callback method/event inside of it. The TextBuffer would just... of its own accord as things are written in on the other methods (and maybe with its own internal, private thread or threadpool worker) grind through the region with the pattern and make callbacks as necessary. Almost like you have an |
As Dustin and I are musing about this... your |
OK we all discussed this with Teams. I'm willing to concede this point because Hyperlinks are so interesting here that they push the boundaries of this sort of unified model. And where the threads live is a bit contentious. And Dustin keeps coming up with more ideas why, while this model sort of works, it has sharp edges. So I'm fine with proceeding per what this draft has as a design. |
This comment has been minimized.
This comment has been minimized.
New misspellings found, please review:
To accept these changes, run the following commands
|
… before any scrolling happens
Yeah we were only clearing/updating the pattern tree on mouse scrolling, changed it to update on either mouse or scroll bar scrolling |
src/cascadia/WindowsTerminalUniversal/WindowsTerminalUniversal.vcxproj
Outdated
Show resolved
Hide resolved
|
Very close to signoff. Just a few oddball comments. |
|
I edited your PR body down to be a nice commit body :) |
|
Hello @PankajBhojwani! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
2bf5d18
into
main

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.




This pull request is the initial implementation of hyperlink auto
detection
Overall design:
should know about
output/scrolling), TerminalControl tells TerminalCore (through a
throttled function for performance) to retrieve the visible pattern
locations from the TextBuffer
pattern, it paints that region differently
References #5001
Closes #574