colortool doesn't work when output is redirected to $null #3828

Closed
opened 2026-01-30 23:30:56 +00:00 by claunia · 5 comments
Owner

Originally created by @Nayacco on GitHub (Sep 11, 2019).

Environment

Platform     ServicePack    Version            VersionString
--------       -----------      -------              -------------
 Win32NT                         10.0.18362.0     Microsoft Windows NT 10.0.18362.0

Steps to reproduce

if i run the command: colortool SolarizedDarkHigherContrast > $null ,it does not work.

but the command colortool SolarizedDarkHigherContrast works well,i dont want to print the theme information

Expected behavior

Actual behavior

Originally created by @Nayacco on GitHub (Sep 11, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Platform ServicePack Version VersionString -------- ----------- ------- ------------- Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0 ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> if i run the command: `colortool SolarizedDarkHigherContrast > $null` ,it does not work. but the command `colortool SolarizedDarkHigherContrast` works well,i dont want to print the theme information # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> # Actual behavior <!-- What's actually happening? -->
Author
Owner

@zadjii-msft commented on GitHub (Sep 11, 2019):

Did you maybe try colortool -q to not display the table? colortool -? will display all the options available.

@zadjii-msft commented on GitHub (Sep 11, 2019): Did you maybe try `colortool -q` to not display the table? `colortool -?` will display all the options available.
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 11, 2019):

ColorTool works, in its traditional mode, by looking at the Console on its output handle. By redirecting the “output” of colortool to $null, you’re making it hard for it to find that console to set the color table. Unless we do a lot of possibly fragile work to dig around and open the actual console you were launched from, this is by design.

In general, applications with a strict dependency on a console connection (as opposed to a text stream) are fragile in this way.

@DHowett-MSFT commented on GitHub (Sep 11, 2019): ColorTool works, in its traditional mode, by looking at the Console on its output handle. By redirecting the “output” of colortool to `$null`, you’re making it hard for it to find that console to set the color table. Unless we do a lot of possibly fragile work to dig around and open the actual console you were launched from, this is by design. In general, applications with a strict dependency on a console connection (as opposed to a text stream) are fragile in this way.
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 11, 2019):

@zadjii-msft @miniksa should ColorTool explicitly open CONOUT$?

@DHowett-MSFT commented on GitHub (Sep 11, 2019): @zadjii-msft @miniksa should ColorTool explicitly open `CONOUT$`?
Author
Owner

@miniksa commented on GitHub (Sep 11, 2019):

@zadjii-msft Mike Griese FTE @miniksa Michael Niksa FTE should ColorTool explicitly open CONOUT$?

It could, but we would have to separate which handle was used to emit the theme information from the one used to send the commands. If we use CONOUT$ for everything, then the redirection to null won't do anything and the theme information will be emitted contrary to expectation.

@miniksa commented on GitHub (Sep 11, 2019): > @zadjii-msft Mike Griese FTE @miniksa Michael Niksa FTE should ColorTool explicitly open `CONOUT$`? It could, but we would have to separate which handle was used to emit the theme information from the one used to send the commands. If we use `CONOUT$` for everything, then the redirection to null won't do anything and the theme information will be emitted contrary to expectation.
Author
Owner

@ghost commented on GitHub (Sep 15, 2019):

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@ghost commented on GitHub (Sep 15, 2019): This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for **4 days**. It will be closed if no further activity occurs **within 3 days of this comment**.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3828