colortool utility sets foreground color to bright white upon exiting if ran with -c #17615

Closed
opened 2026-01-31 05:47:48 +00:00 by claunia · 6 comments
Owner

Originally created by @george-tsiros on GitHub (Jun 1, 2022).

Windows Terminal version

none

Windows build number

10.0.22000.675

Other Software

cmd.exe

Steps to reproduce

run cmd
color 70
colortool -c

Expected Behavior

foreground color is gray ("7")

Actual Behavior

foreground color is white ("f")

Originally created by @george-tsiros on GitHub (Jun 1, 2022). ### Windows Terminal version none ### Windows build number 10.0.22000.675 ### Other Software cmd.exe ### Steps to reproduce run cmd `color 70` `colortool -c` ### Expected Behavior foreground color is gray ("7") ### Actual Behavior foreground color is white ("f")
Author
Owner

@george-tsiros commented on GitHub (Jun 1, 2022):

in program.cs, insert a copy of the lines 152 and 153 between lines 172 and 173

@george-tsiros commented on GitHub (Jun 1, 2022): in program.cs, insert a copy of the lines 152 and 153 between lines 172 and 173
Author
Owner

@zadjii-msft commented on GitHub (Jun 6, 2022):

in program.cs, insert a copy of the lines 152 and 153 between lines 172 and 173

Are we looking at the same file/? In the current main, these are the sections you called out

ed27737233/src/tools/ColorTool/ColorTool/Program.cs (L151-L155)
ed27737233/src/tools/ColorTool/ColorTool/Program.cs (L168-L174)

I don't really think that ~L172 is the right place to be restoring the console mode (and I don't think that would really work for this either...)

I'm also pretty sure that -c is supposed to restore the previous attributes:
ed27737233/src/tools/ColorTool/ColorTool/ColorTable.cs (L146-L149)

@zadjii-msft commented on GitHub (Jun 6, 2022): > in program.cs, insert a copy of the lines 152 and 153 between lines 172 and 173 Are we looking at the same file/? In the current `main`, these are the sections you called out https://github.com/microsoft/terminal/blob/ed27737233714dea77877624d1beeb49e2ccd36e/src/tools/ColorTool/ColorTool/Program.cs#L151-L155 https://github.com/microsoft/terminal/blob/ed27737233714dea77877624d1beeb49e2ccd36e/src/tools/ColorTool/ColorTool/Program.cs#L168-L174 I don't really think that ~L172 is the right place to be restoring the console mode (and I don't think that would really work for this either...) I'm also pretty sure that `-c` is _supposed_ to restore the previous attributes: https://github.com/microsoft/terminal/blob/ed27737233714dea77877624d1beeb49e2ccd36e/src/tools/ColorTool/ColorTool/ColorTable.cs#L146-L149
Author
Owner

@george-tsiros commented on GitHub (Jun 6, 2022):

i had v1.0.0.0

@george-tsiros commented on GitHub (Jun 6, 2022): i had v1.0.0.0
Author
Owner

@zadjii-msft commented on GitHub (Jun 6, 2022):

Can you try a newer version/? The code that looks like it's responsible for restoring the colors is at least in #418, and that shipped as a ColorTool update all the way back in April 2019

@zadjii-msft commented on GitHub (Jun 6, 2022): Can you try a newer version/? The code that looks like it's responsible for restoring the colors is at least in #418, and that shipped as a ColorTool update all the way back in [April 2019](https://github.com/microsoft/terminal/releases/tag/1904.29002)
Author
Owner

@george-tsiros commented on GitHub (Jun 6, 2022):

please close this issue completely, it was my mistake

@george-tsiros commented on GitHub (Jun 6, 2022): please close this issue completely, it was my mistake
Author
Owner

@zadjii-msft commented on GitHub (Jun 6, 2022):

No worries, glad you figured it out!

@zadjii-msft commented on GitHub (Jun 6, 2022): No worries, glad you figured it out!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17615