diff --git a/NEWS.md b/NEWS.md index 80a478bb..2ed305cd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ Red Panda C++ Version 2.25 - change: Symbol completion of '{' won't insert extra new lines. - fix: "move selection up/down" of whole lines selection are no correctly handled. - enhancement: Improvement of terminal support ( from cyano.CN ) + - enhancement: Virtual Terminal Sequences Support in windows 10/11 ( from cyano.CN ) + + Red Panda C++ Version 2.24 diff --git a/tools/consolepauser/main.windows.cpp b/tools/consolepauser/main.windows.cpp index 188d1d98..d2f5d5e3 100644 --- a/tools/consolepauser/main.windows.cpp +++ b/tools/consolepauser/main.windows.cpp @@ -30,6 +30,9 @@ using std::string; #ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING #define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004 #endif +#ifndef ENABLE_PROCESSED_OUTPUT +#define ENABLE_PROCESSED_OUTPUT 0x0001 +#endif #define MAX_COMMAND_LENGTH 32768 #define MAX_ERROR_LENGTH 2048 @@ -170,11 +173,11 @@ void EnableVtSequence() { DWORD mode; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if (GetConsoleMode(hConsole, &mode)) - SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); + SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT); hConsole = GetStdHandle(STD_ERROR_HANDLE); if (GetConsoleMode(hConsole, &mode)) - SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING); + SetConsoleMode(hConsole, mode | ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT); } int main(int argc, char** argv) {