Skip to content

[Bug]: C1 OSC payloads leak into terminal snapshot text #103661

Description

@steipete

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Terminal snapshot cleanup removes 8-bit C1 OSC delimiters but leaves their payload text visible.

Steps to reproduce

  1. On current main, call renderTerminalBufferText("\u009D0;title\u009Cprompt$").
  2. Observe the returned terminal snapshot text.

The same behavior is visible directly through stripAnsiSequences in @openclaw/terminal-core.

Expected behavior

The complete OSC sequence is removed, returning prompt$, matching the existing 7-bit ESC ] ... ST behavior and the narrower terminal-core scanner's C1 OSC handling.

Actual behavior

renderTerminalBufferText returns 0;titleprompt$: the C1 OSC and C1 ST control bytes disappear later, but the title payload leaks into visible terminal text. stripAnsiSequences returns the complete input unchanged.

OpenClaw version

main at 4cc5304178

Operating system

Linux, Blacksmith Testbox

Install method

Source checkout

Model

N/A

Provider / routing chain

N/A

Additional provider/model setup details

N/A

Logs

{"head":"4cc5304178","stripped":"\u009d0;title\u009cprompt$","rendered":"0;titleprompt$","expected":"prompt$"}

Testbox: tbx_01kx5wqe7ba3qdpxmcse36y91g

Screenshots, recordings, and evidence

The deterministic source-level Testbox reproduction above is the evidence; no visual asset is required.

Impact and severity

  • Affected: terminal snapshots and agent shell/tool output paths that use the shared compatibility scanner.
  • Severity: low-to-moderate output-integrity defect.
  • Frequency: deterministic for complete OSC sequences introduced by C1 OSC (U+009D).
  • Consequence: terminal metadata such as title or hyperlink payloads can appear as user-visible output.

Additional information

The shared scanner recognizes C1 CSI and all supported OSC terminators, but its OSC introducer and fast-path gate only recognize the 7-bit ESC ] form. The narrower stripAnsi scanner already recognizes both 7-bit and C1 OSC forms. PR #87343 contains equivalent logic in the deleted legacy scanner owner, but it spans 27 unrelated files and was superseded when PR #99718 moved the grammar into terminal-core; this issue tracks the focused fix in the current canonical owner.

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.bugSomething isn't workinggatewayGateway runtimemaintainerMaintainer-authored PR

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions