Skip to content

Default to stdout isatty for colour detection instead of stderr #128595

Closed
@hugovk

Description

@hugovk

Bug report

Bug description:

The terminal colour detection defaults to checking stderr's isatty, rather than stdout.

As suggested at #128317 (comment), let's default to checking stdout's isatty rather than stderr's.

Here some example output, plus when piping it:

NowProposal
image image
image image
image image
image image

CPython versions tested on:

3.13, CPython main branch

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions