Skip to content

Commit

Permalink
wip: hopefully fix terminal setup on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mhx committed Dec 25, 2023
1 parent f7a6918 commit 71670ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dwarfs/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void WindowsEmulateVT100Terminal(DWORD std_handle) {
done = true;

// Enable VT processing on stdout and stdin
auto hdl = ::GetStdHandle(STD_OUTPUT_HANDLE);
auto hdl = ::GetStdHandle(std_handle);

DWORD out_mode = 0;
::GetConsoleMode(hdl, &out_mode);
Expand All @@ -64,7 +64,7 @@ void WindowsEmulateVT100Terminal(DWORD std_handle) {

void setup_terminal() {
#ifdef _WIN32
WindowsEmulateVT100Terminal(STD_OUTPUT_HANDLE);
WindowsEmulateVT100Terminal(STD_ERROR_HANDLE);
::SetConsoleOutputCP(CP_UTF8);
::SetConsoleCP(CP_UTF8);
#endif
Expand Down

0 comments on commit 71670ce

Please sign in to comment.