Skip to content

Add environment variable check to force console output - #145

Open
timwoj wants to merge 1 commit into
masterfrom
topic/timw/143-windows-output-counting
Open

timwoj wants to merge 1 commit into
masterfrom
topic/timw/143-windows-output-counting

Conversation

@timwoj

@timwoj timwoj commented Sep 9, 2026

Copy link
Copy Markdown
Member

Taken from @awelzel's suggestion in #143 (comment).

Fixes #143

@timwoj
timwoj requested a review from bbannier September 15, 2026 01:01
Comment thread btest

else:
if sys.stdout.isatty():
if sys.stdout.isatty() or os.getenv("BTEST_FORCE_CONSOLE_OUTPUT", "0") == "1":

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about adding a proper option for this, and also reading a default from the environment like we do for --progress-bar?

btest/btest

Lines 3026 to 3033 in 1e97bbe

optparser.add_option(
"-P",
"--progress-bar",
action="store_true",
dest="osc94_progress",
default=os.environ.get("BTEST_OSC94_PROGRESS", ""),
help="display progress bar using OSC 9;4 escape sequences (set BTEST_OSC94_PROGRESS to permanently enable)",
)

It would also be nice to add a test for this.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows output displays differently than other platforms

2 participants