Cmd.exe colors are not propagated to WSL #75

Closed
opened 2026-01-30 21:41:31 +00:00 by claunia · 3 comments
Owner

Originally created by @bitcrazed on GitHub (Feb 16, 2018).

From @dulakm on January 14, 2018 12:8

Hello,

I'm not sure if this is a bug or a feature request. I hope this is the right place to ask about it.

  • Your Windows build number:
    10.0.16299.125

  • What you're doing and what's happening:
    When I run command gradle tasks or even cmd.exe /c gradle.bat tasks in CMD I get colorful output:
    image
    When I do the same from WSL (cmd.exe /c gradle.bat tasks), the output looses the color:
    image

Please, can you help me with the issue?

Thank you,
Martin

Copied from original issue: Microsoft/WSL#2843

Originally created by @bitcrazed on GitHub (Feb 16, 2018). _From @dulakm on January 14, 2018 12:8_ Hello, I'm not sure if this is a bug or a feature request. I hope this is the right place to ask about it. * Your Windows build number: 10.0.16299.125 * What you're doing and what's happening: When I run command `gradle tasks` or even `cmd.exe /c gradle.bat tasks` in CMD I get colorful output: ![image](https://user-images.githubusercontent.com/4852580/34915742-9c8664f6-f92b-11e7-9dbe-ff7b74828805.png) When I do the same from WSL (`cmd.exe /c gradle.bat tasks`), the output looses the color: ![image](https://user-images.githubusercontent.com/4852580/34915754-b5a60eb4-f92b-11e7-9b1c-eaac8479c048.png) Please, can you help me with the issue? Thank you, Martin _Copied from original issue: Microsoft/WSL#2843_
Author
Owner

@bitcrazed commented on GitHub (Feb 16, 2018):

From @zadjii-msft on January 16, 2018 18:38

This is unfortunately a known issue with interop as it exists currently. Only the text emitted by Windows executables will be displayed via interop, any API calls they make (such as setting the colors of text) unfortunately won't work.

The good news: @benhillis and I are sitting down today to discuss just this issue :)

@bitcrazed commented on GitHub (Feb 16, 2018): _From @zadjii-msft on January 16, 2018 18:38_ This is unfortunately a known issue with interop as it exists currently. Only the text emitted by Windows executables will be displayed via interop, any API calls they make (such as setting the colors of text) unfortunately won't work. The good news: @benhillis and I are sitting down today to discuss just this issue :)
Author
Owner

@sdtrotter commented on GitHub (Jun 15, 2018):

Has there been any further progress on this issue? I'm putting together a tutorial on using console apps in WSL, and once you notice the lack of color, it's like a splinter of the mind...

BTW, if you are into renaming issues, I would suggest changing this one to something like: Windows console app's colored output shown uncolored when run from WSL.

@sdtrotter commented on GitHub (Jun 15, 2018): Has there been any further progress on this issue? I'm putting together a tutorial on using console apps in WSL, and once you notice the lack of color, it's like a splinter of the mind... BTW, if you are into renaming issues, I would suggest changing this one to something like: _Windows console app's colored output shown uncolored when run from WSL._
Author
Owner

@zadjii-msft commented on GitHub (Jun 15, 2018):

This is actually fixed in current insider's builds.

See #57. I'm not sure we had an official blog post for when we fixed it, but it is out to insiders.

image

That's powershell, running in tmux on WSL, colors working and everything.

@zadjii-msft commented on GitHub (Jun 15, 2018): This is actually fixed in current insider's builds. See #57. I'm not sure we had an official blog post for when we fixed it, but it is out to insiders. ![image](https://user-images.githubusercontent.com/18356694/41473940-8e59d4ba-706f-11e8-961b-d35e92f34c52.png) That's powershell, running in tmux on WSL, colors working and everything.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#75