Skip to content

Support semi-colons in OSC 8 hyperlink URIs#5003

Merged
Tyriar merged 4 commits intoxtermjs:masterfrom
josiahhudson:master
Apr 22, 2024
Merged

Support semi-colons in OSC 8 hyperlink URIs#5003
Tyriar merged 4 commits intoxtermjs:masterfrom
josiahhudson:master

Conversation

@josiahhudson
Copy link
Copy Markdown
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
Copy Markdown
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?

@josiahhudson
Copy link
Copy Markdown
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
Copy Markdown
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
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants