Skip to content

style: enable colors in native Windows consoles - #9

Merged
karalabe merged 1 commit into
dark-bio:mainfrom
karalabe:fix-windows-colors
Sep 15, 2026
Merged

karalabe merged 1 commit into
dark-bio:mainfrom
karalabe:fix-windows-colors

Conversation

@karalabe

Copy link
Copy Markdown
Member

Plain Windows cmd sessions leave TERM and COLORTERM unset, so the CLI selected bold-only output. Normal command output also skipped enabling Windows ANSI processing.

Enable ANSI processing for each terminal stream and use the RGB palette for native Windows consoles. Preserve color opt-outs and plain JSON or redirected output, and disable live progress when ANSI processing is unavailable. A Windows regression test exercises stdout and stderr in a private console with ANSI initially disabled and no Unix terminal variables.

Fixes #7.

Enable ANSI processing before selecting terminal capabilities and use the RGB palette for native Windows consoles without Unix environment variables.

Co-authored-by: Codex <noreply@openai.com>
@karalabe
karalabe merged commit 477ee55 into dark-bio:main Sep 15, 2026
7 of 8 checks passed
karalabe added a commit that referenced this pull request Sep 15, 2026
Enabling ANSI processing makes the console crate's `is_msys_tty()`
return true even for native Windows consoles. The palette check added in
#9 therefore selected bold-only output again, and the Windows regression
test failed.

Identify native console handles with `GetConsoleMode`, keeping RGB
selection independent of whether ANSI is already enabled. Extend the
regression to cover repeated theme initialization on the same console.

Follow-up to #9 for #7.

Co-authored-by: Codex <noreply@openai.com>
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.

Terminal colors are not visible on Windows 💩

1 participant