Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Sanitize Linear text in CLI and SSH terminal output #20478

Description

@coderabbitai

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions