Repository navigation
osc: keep verbatim OSC 7/8/9;9 payloads whole - #1983
Open
raphamorim wants to merge 1 commit into
Open
raphamorim wants to merge 1 commit into
raphamorim wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OSC 7, OSC 8 and OSC 9;9 carry verbatim payloads, but the OSC parser split them on every
;and kept at most 16 params. OSC 8 then used only the third param as the URI, sohttps://x.dev/a;bopened ashttps://x.dev/a, and OSC 7 / 9;9 rejoined the split params in the handler, which still lost anything past the 16th;.The parser now stops splitting once it reaches the verbatim part of these sequences, keeping the
;as data: after7;, after8;<params>;, and after9;9;. Other OSCs (including9;4progress) split as before. The check runs only on a;while the param count is 1 or 2, so the hot path is unchanged.join_paramsis gone.OSC 8 handling:
;, however many;it containsidis given; an emptyid=counts as no idpost-processing(trailing punctuation, unmatched brackets) now only applies to regex matchesCleanup: the regex hint path uses
trim_match_tailinstead of its duplicatepost_process_hyperlink_uri, and the duplicate copy inscreen/mod.rsis removed. The old tests moved over, plus a case for a leading unmatched delimiter.Tests: parser tests for OSC 8, 7 and 9;9 payloads with more than 16
;and for 9;4 still splitting; terminal tests for;in an OSC 8 URI, invalid UTF-8 and8;id=foo;closing.Docs (post-processing scope, OSC 8 URI rule, changelog) are on the
osc8-verbatim-uribranch of rioterm.com.