Skip to content

--color off is ignored by the interactive listen TUI #404

Description

@leggetter

Summary

--color off has no effect on the interactive TUI. A run under a real terminal with the flag set still emitted 48 SGR colour sequences.

Reproduce

hookdeck listen 3030 <source> --color off      # under a controlling pty

Count the \x1b[ SGR sequences in the captured output: 48 with the flag set.

The flag only reaches the non-TTY renderer, where it works correctly (0 SGR sequences).

Why it matters

--color off exists for terminals that render poorly, for accessibility, and for captured output. Silently ignoring it in the mode that produces the most colour is the case where it matters most.

Note it is ignored in a different direction from #403: there, --color off fails to suppress OSC-8 hyperlinks in non-TTY output; here, it fails to suppress SGR colour in TTY output. Same flag, two unrelated gaps, so they are filed separately.

Suggested fix

Thread the colour setting into the interactive renderer, or have it select the plain renderer when colour is disabled.

Testing

Unit on the renderer: assert no SGR sequences are produced when colour is disabled, independent of whether the writer is a terminal.

Related


Filed by Claude on Phil's behalf, from release-candidate testing.

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