-
Notifications
You must be signed in to change notification settings - Fork 28k
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
Only OSC 8 terminal hyperlinks with http
/https
scheme seem be to working
#176812
Comments
Since everything supported this, I relied on it, damn. Would be amazing to have this back. Only non-heuristic way to get clickable file links in the terminal that handle all paths (e.g. paths with spaces) |
We currently do not allow non-http(s) links due to allowNonHttpProtocols here: vscode/src/vs/workbench/contrib/terminalContrib/links/browser/terminalLinkManager.ts Lines 97 to 131 in d89cac9
This may just be a case of adding that property to |
Hm, running code in a terminal generally means one trusts it. After all at this point it has access to a lot of things. Displaying data from untrusted sources without stripping ANSI escapes is more a problem of the tool displaying the data. I think when a terminal link is hovered, VS Code should just show a little link target floaty thing that shows where the link points to. Other terminal emulators do that. If you’re being paranoid, show a little ⚠ when a link label looks like an URI but the corresponding link points to another URI. But that’s a situation people have in the web all the time, so they should know it can happen. |
@flying-sheep sure, but you can |
@Tyriar I understand the reasoning for disabling this, as VS Code focuses pretty strongly on security given its popularity (workspace trust, confirmations when opening links, well-defined extension API), but would it be possible to allow non-HTTP hyperlinks in the terminal via a setting? Something like It seems like implementing this would be a simple pass-through to xterm.js's |
Who needs to sign off on a decision here? This is affecting me pretty much daily (since my testing framework uses this and I simply can’t make VS Code behave) |
If would be nice to support at least |
+1, our framework uses OSC 8 links as one of the exclusive features vs competitors. Missing support in VS Code makes it irrelevant and degrades our productivity. |
Easy testing below, only the first 2 work: printf '\e]8;;http://github.com\e\\http scheme\e]8;;\e\n'
printf '\e]8;;https://github.com\e\\https scheme\e]8;;\e\n'
printf '\e]8;;file:///Users/tyriar/dev/microsoft/vscode\e\\file scheme\e]8;;\e\n'
printf '\e]8;;vscode://file/Users/tyriar/dev/microsoft/vscode:10\e\\vscode scheme (with line number)\e]8;;\e\n'
printf '\e]8;;mailto:foo@bar.com\e\\mailto scheme\e]8;;\e\n' Note that we wouldn't be able to support any arbitrary link without additional work as there are security concerns. |
Which terminal type should we test this in to verify the issue? @Tyriar |
@andreamah bash should work |
Is it possible to open "file:///Users/tyriar/dev/microsoft/vscode" link in vscode by default? In WSL, this link will do nothing. |
@jackzzs yeah the file needs to exist for it to work |
In Windows it works, but doesn't seem to work in WSL2. This may be due to the fact that accessing the file link calls the system's open command, and wsl2 does not handle this kind of command. Considering that the link is opened in vscode, is it a better way to open it in the current vscode editor instead of calling the system's open command to open another vscode window? And this will also fix the WSL problem. |
@jackzzs are you connected to the window via the Remote - WSL extension? If not this is as expected currently. |
Yes,
|
Thank you very much for your patient inspection and answer, looking forward to the fix. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce
http
orhttps
. For example, thevscode
URL scheme:http
/https
scheme. Other OSC 8-capable terminals (like WezTerm) will open the link correctly.Demonstration
Here's a video demonstrating the issue with several other URL schemes:
Screen.Recording.2023-03-10.at.11.28.03.AM.mov
As you can see, only
http
andhttps
URL schemes result in clickable links.Comments
If I remember correctly, this regressed in the 1.74 -> 1.75 update, which leads me to believe it might be related the link improvements introduced in that version.
This functionality can be super useful for tools like Delta, which let you add hyperlinks to line numbers in diffs. When this functionality worked in VS Code 1.74, those links would be clickable:
The text was updated successfully, but these errors were encountered: