Skip to content
Myr

Default to $TERM unset = colour on Win32

Before adoption: this commit came in with the history the project adopted, so no landing records it.

This otherwise respects all other configuration (NO_COLOR, TERM=dumb, &c.), but it's very common for the environment to be lacking TERM, which in that case usually means a pro-verbial TERM=cmd.exe, which is colourful Fixes: 049d1138c94b1654a80b3afc164bcc5c672560f5 ("Don't output colours by default if TERM=dumb or NO_COLOR=1")

authored by наб · committed by David Peter · parent 69c91f5 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Fixes: 049d1138c94b1654a80b3afc164bcc5c672560f5 ("Don't output colours by default if TERM=dumb or NO_COLOR=1")

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:src/options.rs+1 added-1 removed
298 unmodified lines
299 {300 OutputStyleOption::Basic301 } else if env::var_os("TERM")302 .map(|t| t == "unknown" || t == "dumb")303 .unwrap_or(true)303 .unwrap_or(!cfg!(target_os = "windows"))304 || env::var_os("NO_COLOR")305 .map(|t| !t.is_empty())306 .unwrap_or(false)307 {
106 unmodified lines