Skip to content

fix: correctly detect dumb terminal on Windows - #818

Merged
djc merged 2 commits into
console-rs:mainfrom
ugur-eren:fix/is-dumb-check-windows
Jul 1, 2026
Merged

djc merged 2 commits into
console-rs:mainfrom
ugur-eren:fix/is-dumb-check-windows

Conversation

@ugur-eren

Copy link
Copy Markdown
Contributor

Fix incorrect dumb-terminal detection on Windows

The current check for whether to hide the progress bar relies on reading the TERM environment variable directly:

let term_is_dumb_or_unset = match env::var("TERM") {
    Ok(term) => term == "dumb",
    Err(_) => true,
};

This treats an unset TERM as "dumb" and hides the progress bar.

On Windows, TERM is typically not set at all, even in perfectly capable terminals (Windows Terminal, PowerShell, cmd.exe, etc.), so this logic incorrectly hides progress bars on Windows in cases where they should be shown.

Behavior

Unset TERM environment variable is now treated as "not dumb" on Windows.

Note

This depends on is_dumb() being exposed from the console crate. See console-rs/console#290 for the corresponding change adding a public is_dumb() function.

Comment thread Cargo.lock
@djc

djc commented Jul 1, 2026

Copy link
Copy Markdown
Member

(And please add a version bump commit here, too.)

@ugur-eren
ugur-eren force-pushed the fix/is-dumb-check-windows branch from 9005e89 to c6d987e Compare July 1, 2026 13:33
@djc
djc merged commit e4d49d8 into console-rs:main Jul 1, 2026
11 checks passed
@djc

djc commented Jul 1, 2026

Copy link
Copy Markdown
Member

Published 0.18.6, thanks!

@ugur-eren
ugur-eren deleted the fix/is-dumb-check-windows branch July 1, 2026 14:53
sunshowers added a commit to nextest-rs/nextest that referenced this pull request Jul 7, 2026
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.

2 participants