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

Be able to support clicking on embedded links in the mark mode #18310

Closed
StevenBucher98 opened this issue Dec 12, 2024 · 1 comment · Fixed by #18347
Closed

Be able to support clicking on embedded links in the mark mode #18310

StevenBucher98 opened this issue Dec 12, 2024 · 1 comment · Fixed by #18347
Assignees
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) In-PR This issue has a related PR Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Milestone

Comments

@StevenBucher98
Copy link

Description of the new feature

Currently from #13405 support for keyboard use of hyperlinks is supported but does not work for embedded links. For example, when a link is embedded and or does not have the https:// prefix it does not work. Here is a screenshot of scenario where the embedded links are not accessible via keyboard. Image

Proposed technical implementation details

Make embedded links and links that do not have the https:// in the prefix available to be accessed by the mark mode.

@StevenBucher98 StevenBucher98 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Dec 12, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 12, 2024
@carlos-zamora carlos-zamora self-assigned this Dec 12, 2024
@carlos-zamora carlos-zamora added Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Product-Terminal The new Windows Terminal. and removed Needs-Tag-Fix Doesn't match tag requirements labels Dec 12, 2024
@carlos-zamora
Copy link
Member

To navigate to a hyperlink using a keyboard (PR #13405)...

  • enter mark mode (ctrl+shift+m)
  • shift+tab or tab to select a hyperlink
  • ctrl+enter to open it

So yeah, we should navigate to the embedded links too

@carlos-zamora carlos-zamora added this to the Backlog milestone Dec 18, 2024
@carlos-zamora carlos-zamora removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 18, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the In-PR This issue has a related PR label Dec 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Tag-Fix Doesn't match tag requirements label Feb 24, 2025
DHowett pushed a commit that referenced this issue Feb 26, 2025
## Summary of the Pull Request
There's already logic to tab to a hyperlink when we're in mark mode. We
do this by looking at the automatically detected hyperlinks and finding
the next one of interest. This adds an extra step afterwards to find any
embedded hyperlinks and tab to them too.

Since embedded hyperlinks are stored as text attributes, we need to
iterate through the buffer to find the hyperlink and it's buffer
boundaries. This PR tries to reduce the workload of that by first
finding the automatically detected hyperlinks (since that's a fairly
quick process), then using the reduced search area to find the embedded
hyperlink (if one exists).

## Validation Steps Performed
In PowerShell, add an embedded hyperlink as such:
```powershell
${ESC}=[char]27
Write-Host "${ESC}]8;;https://github.com/microsoft/terminal${ESC}\This is a link!${ESC}]8;;${ESC}\"
```
Enter mark mode (ctrl+shift+m) then shift+tab to it.
✅ The "This is a link!" is selected
✅ Verified that this works when searching forwards and backwards

Closes #18310
Closes #15194
Follow-up from #13405
OSC 8 support added in #7251

(cherry picked from commit 35bd607)
Service-Card-Id: PVTI_lADOAF3p4s4AxadtzgXBDb8
Service-Version: 1.23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) In-PR This issue has a related PR Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants