Skip to content

feat: add is_dumb public function#290

Open
ugur-eren wants to merge 1 commit into
console-rs:mainfrom
ugur-eren:feat/add-is-dumb-public-function
Open

feat: add is_dumb public function#290
ugur-eren wants to merge 1 commit into
console-rs:mainfrom
ugur-eren:feat/add-is-dumb-public-function

Conversation

@ugur-eren

@ugur-eren ugur-eren commented Jun 30, 2026

Copy link
Copy Markdown

Add public is_dumb() function

Exposes a new public function is_dumb() that provides a fast way to check whether the application has a "dumb" terminal (i.e. TERM is unset or set to dumb on Unix; TERM explicitly set to dumb on Windows).

This logic previously existed only as an inline check inside is_a_color_terminal(). This PR extracts it into a dedicated is_a_dumb_terminal() function per platform (unix_term.rs, windows_term/mod.rs, wasm_term.rs), and wires it up through a new public is_dumb() in term.rs, re-exported from lib.rs.

Behavior

No change to existing is_a_color_terminal() output. This is a pure refactor for that path. New behavior is only the addition of the standalone is_dumb() API.

Note

is_dumb() semantics differ slightly by platform when TERM is unset (Unix treats unset as dumb but Windows does not, since native Windows terminals typically don't set TERM).

This is intentional and documented on the function.

This PR is in relation to conversation on PR console-rs/indicatif#808

@ugur-eren ugur-eren marked this pull request as draft June 30, 2026 17:02
@ugur-eren ugur-eren marked this pull request as ready for review June 30, 2026 17:08
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.

1 participant