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

Handle ESC \ string terminators in OSC and APC #159

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

DrJosh9000
Copy link
Contributor

@DrJosh9000 DrJosh9000 commented Jul 2, 2024

Fixes #101 - note the description of #101 is a bit off. 0x9C is historical as a string terminator (ST), but a common ST in use today (e.g. for hyperlinks with the extension ESC ]8;;link ST) is actually the two byte sequence ESC \.

This is relevant to #58 as this is a step towards accepting at least one hyperlink extension known to iTerm (and others) in its possible forms. However this PR will break this amazing hack...

This PR includes a small tidyup of the parser modes enum. We don't use shouty-case constants in Go.

This includes a small tidyup of the parser modes enum
@DrJosh9000 DrJosh9000 requested a review from pda July 2, 2024 05:39
@wolfeidau wolfeidau self-requested a review July 2, 2024 05:46
Copy link
Member

@pda pda left a comment

Choose a reason for hiding this comment

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

Nice!

I haven't run the code or tests to verify, so take my ✅ with a pinch of salt, but both the intent and the code look good 👌🏼

@DrJosh9000 DrJosh9000 force-pushed the handle-escape-backslash-string-terminators branch from 46025ee to 79d8492 Compare July 2, 2024 06:01
@DrJosh9000
Copy link
Contributor Author

I was shown some input (from a customer) that rendered strangely, which led me down the path of this fix, and I've tested it on that input.

@DrJosh9000 DrJosh9000 merged commit e6d96bd into main Jul 2, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the handle-escape-backslash-string-terminators branch July 2, 2024 06:36
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.

APC with standard ST terminator would break parser
2 participants