Skip to content

fix(output): escape external terminal controls without mutating JSON - #255

Merged
abruption merged 4 commits into
mainfrom
abruption/v103-issue-239
Oct 5, 2026
Merged

abruption merged 4 commits into
mainfrom
abruption/v103-issue-239

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

Escape C0, DEL and C1 controls in human-facing external fields before rendering, preserving ordinary Unicode and renderer-owned line breaks. Cover list, doctor, send, update/notices and CLI/SSH errors without changing JSON or outgoing message bodies.

Closes #239

Type

  • fix

Checklist

  • One idempotent display-only helper; copied containers, raw keys preserved.
  • Generated standalone consistency and scoped regression tests.
  • No terminal was driven and no remote host or real session contacted.

Verified against

Python 3.13.7, macOS arm64: independently reran 13 new human-output tests. OSC52/OSC8/CSI/C1/BEL, column alignment, stderr, argparse, Unicode, exact JSON bytes and unchanged outgoing bodies covered. Worker core and adapter suites also passed. Independent read-only review completed.

Notes

Untrusted exception-message line breaks are deliberately escaped; renderer formatting remains separate. JSON bytes retain the existing contract, including its existing Unicode behavior: this is not a promise that raw JSON is safe to render as terminal text. Bidi/zero-width spoofing is not addressed. Draft only, no merge/release/deployment.

@abruption abruption added this to the v1.0.3 milestone Oct 3, 2026
@abruption

Copy link
Copy Markdown
Owner Author

Review follow-up implemented in fd952342.

Paired-device list/send rendering now uses a display-only sanitized copy of Receiver response fields. JSON keeps the original bytes, outgoing message bodies remain unchanged, and renderer-owned line breaks remain separate. Offline device fixtures cover C0/C1/OSC status/session fields, guidance and failure reasons.

Verified: 18 related human/device-output/generation tests. The local integration retains both MessageArgumentParser and HumanArgumentParser(MessageArgumentParser) and regenerates the standalone; do not discard either method when reconciling #254. No live receiver or message submission; draft retained.

@abruption

Copy link
Copy Markdown
Owner Author

Optional consistency improvement addressed in d78a0ec: internal device/relay management parsers now use the same safe error handling as the canonical CLI, including inherited action parsers. Offline tests exercise real core.main failures before any store/credential/receiver/relay effects, preserving trusted usage/help/exit 2/defaults and raw valid argv/JSON.

The integration retains MessageArgumentParser and HumanArgumentParser(MessageArgumentParser); management adopts that composed class. Relevant focused tests and generation checks pass; full integration is 707 tests with 14 skips. No real receiver, message or operating changes; draft retained.

@abruption
abruption merged commit 8ccf9de into main Oct 5, 2026
28 checks passed
@abruption
abruption deleted the abruption/v103-issue-239 branch October 5, 2026 00:17
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.

fix(output): neutralize terminal control sequences in human-readable output

1 participant