enable virtual terminal processing on Windows

This commit is contained in:
tildearrow 2023-04-06 17:13:51 -05:00
parent 829d51411a
commit c6f1ec5756
2 changed files with 12 additions and 3 deletions

View file

@ -53,8 +53,8 @@
#define EXTERN_BUSY_BEGIN_SOFT e->softLocked=true; e->isBusy.lock();
#define EXTERN_BUSY_END e->isBusy.unlock(); e->softLocked=false;
#define DIV_VERSION "dev149"
#define DIV_ENGINE_VERSION 149
#define DIV_VERSION "dev151"
#define DIV_ENGINE_VERSION 151
// for imports
#define DIV_VERSION_MOD 0xff01
#define DIV_VERSION_FC 0xff02

View file

@ -134,7 +134,16 @@ int writeLog(int level, const char* msg, fmt::printf_args args) {
}
void initLog() {
// initalize log buffer
// initialize coloring on Windows
#ifdef _WIN32
HANDLE winout=GetStdHandle(STD_OUTPUT_HANDLE);
int termprop=0;
GetConsoleMode(winout,(LPDWORD)&termprop);
termprop|=ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(winout,termprop);
#endif
// initialize log buffer
logPosition=0;
for (int i=0; i<TA_LOG_SIZE; i++) {
logEntries[i].text.reserve(128);