Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Exposing isatty method in WrappingIO #254

Copy link
Copy link

Description

@piotrbartman
Issue body actions

Description

If the use of click wrapping on stdout causes click to not recognize standard output as a terminal and all formatting (ANSI codes) is discarded.

Code

import click
import progressbar

progressbar.streams.wrap_stdout()
click.secho("text", fg="red")
# white text

It can be fixed by:

sys.stdout.isatty = progressbar.streams.original_stdout.isatty

I think it can be fixed by expose in WrappingIO class isatty method of target.

Versions

  • Python version: 3.9.2
  • Python distribution/environment: CPython/Anaconda/IPython/IDLE
  • Operating System: Debian
  • Package version: 3.53.1
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.