Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow colored terminal output on Windows if ENABLE_VIRTUAL_TERMINAL_PROCESSING is set #843

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chausner
Copy link

@chausner chausner commented Sep 30, 2023

This improves the compatibility of the LoggingFlag::ColoredTerminalOutput setting on Windows.

Windows 10 and later introduced virtual terminal support in conhost and Windows Terminal, see also https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences. This adds logic to easylogging++ to detect when virtual terminal processing is enabled, to allow colored output if LoggingFlag::ColoredTerminalOutput is set.

Before, easylogging++ would not attempt to output VT colored text even if the user enabled LoggingFlag::ColoredTerminalOutput and the terminal supports it.

With this change, running the all-logs sample in Windows Terminal:

image

This is a

  • Breaking change
  • New feature
  • Bugfix

I have

@robloh
Copy link

robloh commented Feb 27, 2024

Thanks for this patch! Can confirm it works on Windows 10 with VS2019.

@chausner
Copy link
Author

chausner commented Mar 1, 2024

@abumq Any chance of getting this merged? :)

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.

None yet

2 participants