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

Support semi-colons in OSC 8 hyperlink URIs #5003

Merged
merged 4 commits into from Apr 22, 2024
Merged

Conversation

josiahhudson
Copy link
Contributor

Original code performed a simple data.split(';') which split on every ";" in the string. This new version treats the first ";" as the only split character, ensuring that params are properly separated from the URI.

jerch
jerch previously requested changes Mar 15, 2024
Copy link
Member

@jerch jerch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josiahhudson Thx for looking into this. I have a few remarks:

  • Plz see my comment below, imho doing it with a regexp is a bit over-engineered.
  • Would also be nice to have this covered by a test case.
  • I just saw, that the setHyperlink handler returns false in some cases, which is suboptimal, as the parser has an optimization for the the true case (since it is a default handler in xterm.js it can always return true). Could you also change that?

src/common/InputHandler.ts Outdated Show resolved Hide resolved
@josiahhudson
Copy link
Contributor Author

josiahhudson commented Mar 17, 2024

lol, feedback makes sense. Happy to make the changes. I struggled to find a good place to put a test when I was looking at this, but I was short on time so I'll give it another go. I'll do it earlier if I can, but I may not have time to look at this again till Friday.

@Tyriar Tyriar added this to the 5.6.0 milestone Apr 21, 2024
@Tyriar Tyriar self-assigned this Apr 21, 2024
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @josiahhudson, I tweaked it to use @jerch's suggestion and added a couple of tests

@Tyriar Tyriar changed the title Fix for issue #4944. Support semi-colons in OSC 8 hyperlink URIs Apr 21, 2024
@Tyriar Tyriar enabled auto-merge April 21, 2024 15:39
@Tyriar Tyriar merged commit 826c057 into xtermjs:master Apr 22, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants