fix(terminal): strip C1 OSC payloads from output#103672
Merged
Merged
Conversation
Contributor
Author
|
Land-ready at exact head Proof:
The separate problem of escape sequences split across output chunks is deliberately excluded and tracked in #103668. |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 11, 2026
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.
Closes #103661
What Problem This Solves
Fixes an issue where terminal snapshots and sanitized agent output exposed OSC title, hyperlink, or clipboard payload text when a producer used the 8-bit C1 OSC introducer (
U+009D). The delimiters were removed later, but the metadata payload remained visible as ordinary terminal text.Why This Change Was Made
The shared terminal scanner now recognizes both ECMA-48 OSC introducers and all three supported string terminators through common pattern constants. The compatibility scanner keeps its historical broad payload behavior, while the sanitizing scanner keeps its stricter payload rules; only C1 OSC handling changes. The fast path also recognizes
U+009Dso these sequences reach the scanner.User Impact
Terminal snapshot text and downstream sanitized output no longer display metadata carried in C1 OSC sequences. Adjacent emoji, CJK text, and prompts remain unchanged.
Evidence
mainTestbox repro (4cc5304178):\u009D0;title\u009Cprompt$rendered as0;titleprompt$; expectedprompt$.corepack pnpm check:changedpassed on Testbox (guards, tsgo core/core-test, lint, and scoped repository checks).corepack pnpm format:check packages/terminal-core/src/ansi.ts packages/terminal-core/src/ansi.test.ts src/gateway/terminal/buffer-text.test.tspassed.AI-assisted implementation and review.