Option to display stderr in a different color #13029

Open
opened 2026-01-31 03:31:49 +00:00 by claunia · 0 comments
Owner

Originally created by @stevenwdv on GitHub (Mar 14, 2021).

Description of the new feature/enhancement

I'm not sure if this has been requested before (I couldn't find it), but I think it would be nice to have the option in the settings to display error output (stderr) in a different color/style than normal output (stdout). For example, this would make it possible to automatically print make the text in std::cerr << "This is an error\n"; red.

I'm not sure how difficult this would be to realize, because normally GetStdHandle(STD_OUTPUT_HANDLE) and GetStdHandle(STD_ERROR_HANDLE) point to the same device. I'm also not sure how this would impact ANSI escape codes being sent to either stream affecting the other or not.

Additionally, this may impact the ability to invoke SetConsoleTextAttribute for the two handles separately, like e.g. this person tried to do.

Originally created by @stevenwdv on GitHub (Mar 14, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> I'm not sure if this has been requested before (I couldn't find it), but I think it would be nice to have the option in the settings to display error output (stderr) in a different color/style than normal output (stdout). For example, this would make it possible to automatically print make the text in `std::cerr << "This is an error\n";` red. I'm not sure how difficult this would be to realize, because normally `GetStdHandle(STD_OUTPUT_HANDLE)` and `GetStdHandle(STD_ERROR_HANDLE)` point to the same device. I'm also not sure how this would impact ANSI escape codes being sent to either stream affecting the other or not. Additionally, this may impact the ability to invoke `SetConsoleTextAttribute` for the two handles separately, like e.g. [this person tried to do](https://stackoverflow.com/q/4920661). <!--# Proposed technical implementation details (optional) <!-- A clear and concise description of what you want to happen. -->
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13029