You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.
Enable color output in Windows viewer debug console
Type
New Feature Request
Priority
Unset
Status
Accepted
Resolution
Unresolved
Reporter
Nat Linden (nat.linden)
Created at
2020-05-29T21:10:56Z
Updated at
2020-06-03T15:47:14Z
{
'Build Id': 'unset',
'Business Unit': ['Platform'],
'Date of First Response': '2020-05-30T08:14:23.219-0500',
'How would you like the feature to work?': 'Enabling the Windows debug console displays messages in color.',
'ReOpened Count': 0.0,
'Severity': 'Unset',
'Target Viewer Version': 'viewer-development',
'Why is this feature important to you? How would it benefit the community?': 'Output on the Windows debug console would regain parity with the Mac console log, which can display colors.',
}
The text was updated successfully, but these errors were encountered:
Extend the #!LL_WINDOWS near line 40 with an #else and #include <io.h> for Windows only
Take out the platform tests in checkANSI() so that the code runs on Windows too, the return FALSE becomes surplus too
In llappviewerwin32.cpp
Make sure that ENABLE_VIRTUAL_TERMINAL_PROCESSING is defined just after setting MAX_CONSOLE_LINES
const S32 MAX_CONSOLE_LINES = 500;
// Only defined in newer SDKs than we currently use
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 4
#endif
Extend all three of the stream opening/redirecting clauses with this code after each setvbuf
DWORD dwMode = 0;
GetConsoleMode((HANDLE)l_std_handle, &dwMode);
dwMode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode((HANDLE)l_std_handle, dwMode);
Background note - from Windows 10, the console window gained colour compatibility. Now that the official target is Windows 10 plus, it's safe to make this standard behaviour.
The Windows 10 console can support color output, if set to the appropriate mode. Set that mode when creating the viewer's debug console.
Attachments
Original Jira Fields
The text was updated successfully, but these errors were encountered: