Summary
Add a shared sanitizer for all Linear text that is rendered in terminal output.
Rationale
The Linear CLI formatter and the SSH fallback formatter currently write Linear-provided text directly to terminal output. A sanitizer must apply consistently to every rendered Linear text field. Sanitizing only the cycle name would make that field inconsistent with the surrounding fields.
Affected areas
src/cli/linear-format.ts
src/main/ssh/ssh-remote-linear-output.ts
- Shared Linear formatting utilities, including
src/shared/linear/cycle-label.ts where applicable
Required changes
- Define a shared sanitizer for Linear text intended for terminal output.
- Apply the sanitizer to issue title, state name, assignee name, project name, label names, and cycle name in both formatter paths.
- Prevent terminal control characters, including line breaks and ANSI/OSC escape sequences, from changing terminal output structure or behavior.
- Preserve existing display behavior for ordinary printable Linear text.
- Add regression tests for malicious or malformed Linear text in both standard CLI and SSH fallback output.
Acceptance criteria
- Both formatter paths use the same sanitizer.
- All rendered Linear text fields use the sanitizer.
- Tests cover control-character inputs and confirm that terminal control sequences do not pass through.
- Existing tests for normal issue output continue to pass.
Backlinks
Requested by @luanAfons0.
Summary
Add a shared sanitizer for all Linear text that is rendered in terminal output.
Rationale
The Linear CLI formatter and the SSH fallback formatter currently write Linear-provided text directly to terminal output. A sanitizer must apply consistently to every rendered Linear text field. Sanitizing only the cycle name would make that field inconsistent with the surrounding fields.
Affected areas
src/cli/linear-format.tssrc/main/ssh/ssh-remote-linear-output.tssrc/shared/linear/cycle-label.tswhere applicableRequired changes
Acceptance criteria
Backlinks
Requested by @luanAfons0.