fix:修正服务端彩色打印。

This commit is contained in:
taynpg 2025-01-22 09:35:38 +08:00
parent 06b54a3b1a
commit a454ce6747

@ -2,8 +2,26 @@
#include "version.h"
#include <iostream>
#ifdef _WIN32
#include <fcntl.h>
#include <io.h>
#include <windows.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
#endif
int main(int argc, char* argv[])
{
#ifdef _WIN32
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD mode;
GetConsoleMode(hConsole, &mode);
mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING;
SetConsoleMode(hConsole, mode);
#endif
mpinfo("Build At {} {} under {} on {}", __DATE__, __TIME__, VERSION_GIT_COMMIT, VERSION_GIT_BRANCH);
int port = 9898;
if (argc < 2) {