\brief Constructor - Initialize console
| 18 | #ifdef _WIN32 |
| 19 | /// \brief Constructor - Initialize console |
| 20 | CLIWide::CLIWide() { |
| 21 | // Get console handles |
| 22 | hConsoleInput = GetStdHandle(STD_INPUT_HANDLE); |
| 23 | hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE); |
| 24 | |
| 25 | // Store original modes |
| 26 | GetConsoleMode(hConsoleInput, &originalInputMode); |
| 27 | GetConsoleMode(hConsoleOutput, &originalOutputMode); |
| 28 | |
| 29 | // Set input mode for raw input to capture all Unicode characters |
| 30 | // But keep ENABLE_PROCESSED_INPUT to handle Ctrl+C properly |
| 31 | DWORD inputMode = ENABLE_PROCESSED_INPUT | ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT | ENABLE_EXTENDED_FLAGS; |
| 32 | SetConsoleMode(hConsoleInput, inputMode); |
| 33 | |
| 34 | // Set output mode for UTF-8 |
| 35 | DWORD outputMode = ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING; |
| 36 | SetConsoleMode(hConsoleOutput, outputMode); |
| 37 | |
| 38 | // Set console to UTF-8 mode |
| 39 | SetConsoleOutputCP(CP_UTF8); |
| 40 | SetConsoleCP(CP_UTF8); |
| 41 | } |
| 42 | |
| 43 | /// \brief Destructor - Restore console modes |
| 44 | CLIWide::~CLIWide() { |
nothing calls this directly
no outgoing calls
no test coverage detected