Enable console output target on Windows by default by Joannis · Pull Request #88 · onevcat/Rainbow · GitHub
Skip to content

Enable console output target on Windows by default - #88

Merged
onevcat merged 2 commits into
onevcat:masterfrom
Joannis:jo/windows
Jul 11, 2026
Merged

onevcat merged 2 commits into
onevcat:masterfrom
Joannis:jo/windows

Conversation

@Joannis

@Joannis Joannis commented Dec 20, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #87

Modern Windows terminals (Windows 10+, Windows Terminal, PowerShell) support ANSI escape codes. This change enables colored output by default on Windows by returning .console as the detected output target.

Changes

  • Added #if os(Windows) conditional compilation to return .console directly on Windows
  • Keeps existing TTY detection behavior on other platforms

@onevcat

onevcat commented Jan 6, 2026

Copy link
Copy Markdown
Owner

@Joannis

Joannis commented Jan 8, 2026

Copy link
Copy Markdown
Contributor Author

I can try that, IIRC Windows' terminals don't have all of the APIs you'd expect so I'm not certain isatty is available.

@Joannis

Joannis commented Jan 19, 2026

Copy link
Copy Markdown
Contributor Author

Hey @onevcat , sorry about the delay. Was not paying attention too much - but I've updated it

@Joannis

Joannis commented Jan 19, 2026

Copy link
Copy Markdown
Contributor Author

I forgot Windows likes to underscore symbols

@Joannis

Joannis commented Feb 10, 2026

Copy link
Copy Markdown
Contributor Author

@onevcat
onevcat merged commit 2ea7ec1 into onevcat:master Jul 11, 2026
3 checks passed
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.

Default OutputTarget.current is not .console on Windows

2 participants