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

; inside the URL breaks the OSC hyperlink #4944

Closed
schaffino opened this issue Jan 22, 2024 · 7 comments
Closed

; inside the URL breaks the OSC hyperlink #4944

schaffino opened this issue Jan 22, 2024 · 7 comments
Assignees
Labels
Milestone

Comments

@schaffino
Copy link

Tried this in both VSCode and Jupyterlab. It seems the OSC hyperlink integration doesn't work properly when the linked URL contains a ';'

The following submitted to terminator terminal emulator results in a link directing me to https://www.example.com/query;arg=1;arg=2;arg=3

printf '\e]8;;https://www.example.com/query;arg=1;arg=2;arg=3\e\\This is a link\e]8;;\e\\n'

Running the same in jupyter or VSCode, I end up being redirected to https://www.example.com/query, with the arguments truncated

Details

  • Browser and browser version: Any
  • OS version: Any
  • xterm.js version: Any supporting OSC hyperlinks

Steps to reproduce

  1. Output a valid OSC hyperlink in tooling using xterm.js (See printf statement above)
  2. Observe the link is truncated
@Tyriar
Copy link
Member

Tyriar commented Jan 30, 2024

Before fixing this we should verify that ; is expected to be supported when not URL encoded as %3B

@jerch
Copy link
Member

jerch commented Jan 30, 2024

@Tyriar https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#encodings states, that additional uri params may not contain : or ; due to its ambiguity with the sequence syntax. Thus I'd say this works as intended by the spec. And an error recovery strategy for excess parts separated by additional ; is not defined, which makes it undefined behavior.

@Tyriar
Copy link
Member

Tyriar commented Jan 30, 2024

Cool, I suspected that might be the case. Closing as designed then

@Tyriar Tyriar closed this as completed Jan 30, 2024
@Tyriar Tyriar added as-designed and removed type/bug Something is misbehaving help wanted good first issue labels Jan 30, 2024
@schaffino
Copy link
Author

schaffino commented Feb 2, 2024

@Tyriar @jerch
The parameters its referencing in the doc above is referring to the optional parameter argument of the OSC-8 hyperlink, not query parameters in the URI. It states that only id is specifically defined in the spec for this argument. My reading is that the URI can still be any string in the range 32–126. Given most other terminal emulators support this i believe this is still a bug.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda#the-escape-sequence

Without support for ; there are plenty of valid URI's that cannot be linked

@Tyriar
Copy link
Member

Tyriar commented Feb 2, 2024

@schaffino makes sense, thanks for the follow up. I read the "additional parameters" part wrong.

@Tyriar Tyriar reopened this Feb 2, 2024
@Tyriar Tyriar added type/bug Something is misbehaving help wanted good first issue and removed as-designed labels Feb 2, 2024
@jerch
Copy link
Member

jerch commented Feb 2, 2024

Eww, seems I also misread that.

@josiahhudson
Copy link
Contributor

Attempted a fix here: #5003

@Tyriar Tyriar added this to the 5.6.0 milestone Apr 21, 2024
@Tyriar Tyriar self-assigned this Apr 21, 2024
@Tyriar Tyriar closed this as completed in b40e58b Apr 22, 2024
@Tyriar Tyriar modified the milestones: 5.6.0, 6.0.0 Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants