diff --git a/libc/runtime/winmain.greg.c b/libc/runtime/winmain.greg.c index e8287dc2..d3e9d2d3 100644 --- a/libc/runtime/winmain.greg.c +++ b/libc/runtime/winmain.greg.c @@ -97,6 +97,7 @@ static noasan textwindows wontreturn void WinMainNew(void) { SetConsoleCP(kNtCpUtf8); SetConsoleOutputCP(kNtCpUtf8); inhand = GetStdHandle(pushpop(kNtStdInputHandle)); + SetEnvironmentVariable(u"TERM", u"xterm-truecolor"); GetConsoleMode(inhand, &__ntconsolemode); SetConsoleMode(inhand, kNtEnableProcessedInput | kNtEnableLineInput | kNtEnableEchoInput | kNtEnableMouseInput | diff --git a/tool/viz/memzoom.c b/tool/viz/memzoom.c index d2da49a1..a4a84a17 100644 --- a/tool/viz/memzoom.c +++ b/tool/viz/memzoom.c @@ -318,6 +318,7 @@ static void PreventBufferbloat(void) { static bool HasPendingInput(void) { struct pollfd fds[1]; + if (IsWindows()) return true; /* XXX */ fds[0].fd = 0; fds[0].events = POLLIN; fds[0].revents = 0; @@ -841,16 +842,19 @@ static void RangesZoom(void) { } static void MemZoom(void) { + bool ok; + ok = false; do { if (action & RESIZED) { GetTtySize(); SetupCanvas(); action &= ~RESIZED; } - if (HasPendingInput()) { + if (ok && HasPendingInput()) { ReadKeyboard(); - continue; + if (!IsWindows()) continue; /* XXX */ } + ok = true; if (pid) { RangesZoom(); } else {