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

ANSI OSC 8 hyperlink support NOT working properly (#155445) #170963

Closed
smallscript opened this issue Jan 10, 2023 · 13 comments · Fixed by #210280
Closed

ANSI OSC 8 hyperlink support NOT working properly (#155445) #170963

smallscript opened this issue Jan 10, 2023 · 13 comments · Fixed by #210280
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders terminal-links verified Verification succeeded
Milestone

Comments

@smallscript
Copy link

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.74.2
  • OS Version: Windows 10

In reference to Support OSC 8 hyperlink support #155445.

Per this gist spec it works properly in wt.exe but not in VsCode.

    # OSC 8 ; params ; URI ST <name> OSC 8 ;; ST 
    escape_mask = '\033]8;{};{}\033\\{}\033]8;;\033\\'

After about 6 hours of experimentation (in various MS-Windows based terminals) to understand why it was not working, I figured out the bug in VsCode.

In the example steps below I provide two forms

  • a first (incorrect) form works in wt.exe and also sort-of works in VsCode.
  • a second (per-gist correct) form works in wt.exe but does not work in VsCode.
    • where we introduce a SPACE in the closing OSC ; ;.

The example shows the trigger/change to make it sort-of work in VsCode.

You will notice that when made to sort-of work in VsCode the ENTIRE line from start to end including the prompt becomes the link, which is wrong. It is a very quirky and touchy bug behavior.

Steps to Reproduce: (these steps worked 100%, other variations required pre-conditions)

  1. If we introduce a SPACE in the closing OSC ; ; we can get VsCode to work (incorrectly) as opposed to not-at-all.
# VsCode WORKS: (incorrectly) includes ENTIRE LINE and PROMPT as LINK
# i.e., VsCode acts like `[BEFORE-LINK ctrl-click-here AFTER-LINK](http://example.com)`
# should act like `BEFORE-LINK [ctrl-click-here\n](http://example.com) AFTER-LINK`
#
# wt.exe WORKS
# wt.exe acts like `BEFORE-LINK [ctrl-click-here\n](http://example.com) AFTER-LINK`
works_vsc = 'BEFORE-LINK \x1B]8;;http://example.com\x1B\\ctrl-click-here\x1B]8; ;\x1B\\ AFTER-LINK'

# VsCode FAILS: in this correct format, which works with no issues in wt.exe
#
# wt.exe WORKS
# i.e., wt.exe acts like `BEFORE-LINK [ctrl-click-here](http://example.com) AFTER-LINK`
fails_vsc 'BEFORE-LINK \x1B]8;;http://example.com\x1B\\ctrl-click-here\x1B]8;;\x1B\\ AFTER-LINK'

print(works_vsc)
print(fails_vsc)
@alexr00 alexr00 assigned hediet and unassigned alexr00 Jan 10, 2023
@alexr00 alexr00 assigned Tyriar and unassigned hediet Jan 10, 2023
@joyceerhl joyceerhl added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues labels Dec 13, 2023
@Tyriar Tyriar added terminal-links and removed terminal Integrated terminal issues labels Dec 14, 2023
@Tyriar Tyriar added this to the Backlog milestone Dec 14, 2023
@Tyriar
Copy link
Member

Tyriar commented Dec 14, 2023

Upstream: xtermjs/xterm.js#4916

@Tyriar Tyriar added help wanted Issues identified as good community contribution opportunities good first issue Issues identified as good for first-time contributors labels Dec 14, 2023
@smallscript
Copy link
Author

smallscript commented Feb 29, 2024 via email

@Tyriar
Copy link
Member

Tyriar commented Apr 12, 2024

Upstream fix: xtermjs/xterm.js#5027

@Tyriar Tyriar modified the milestones: Backlog, April 2024 Apr 12, 2024
Tyriar added a commit that referenced this issue Apr 13, 2024
@Tyriar Tyriar mentioned this issue Apr 13, 2024
@smallscript
Copy link
Author

Looking forward to that Tyriar. If the cls back-buffer behavior also worked like wt.exe it would be the best day all year.
🙇🏻‍♂️

@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Apr 14, 2024
@rzhao271
Copy link
Contributor

With pwsh and cmd on Windows Terminal, it seems to me that only the http://example.com portion is underlined.
On VS Code, http://example.com\x1B\\ctrl-click-here\x1B is underlined.
I'd like to check whether either behaviour is as expected for you, @smallscript?

@rzhao271 rzhao271 added the author-verification-requested Issues potentially verifiable by issue author label Apr 24, 2024
@VSCodeTriageBot
Copy link
Collaborator

This bug has been fixed in the latest release of VS Code Insiders!

@smallscript, you can help us out by commenting /verified if things are now working as expected.

If things still don't seem right, please ensure you're on version 6d23b7f of Insiders (today's or later - you can use Help: About in the command palette to check), and leave a comment letting us know what isn't working as expected.

Happy Coding!

@smallscript
Copy link
Author

smallscript commented Apr 25, 2024 via email

@smallscript
Copy link
Author

smallscript commented Apr 25, 2024 via email

@rzhao271
Copy link
Contributor

I'll clarify my question. Has your original issue, #170963 (comment), been resolved on VS Code Insiders? You can get a copy of VS Code Insiders from https://code.visualstudio.com/insiders/.

As for the back buffer issue, feel free to open a new issue in this repository.

@smallscript
Copy link
Author

smallscript commented Apr 25, 2024 via email

@Tyriar
Copy link
Member

Tyriar commented May 2, 2024

Verified:

image
image

@Tyriar Tyriar added the verified Verification succeeded label May 2, 2024
@smallscript
Copy link
Author

smallscript commented May 3, 2024 via email

@Tyriar
Copy link
Member

Tyriar commented May 3, 2024

@smallscript it's likely a Windows 10 problem caused by conpty which is shipped by Windows then. Unfortunately the fix there is to upgrade to Windows 11 which has the newer component.

@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders terminal-links verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants