diff --git a/src/fprint.hpp b/src/fprint.hpp index 22e5bc0..b494fb5 100644 --- a/src/fprint.hpp +++ b/src/fprint.hpp @@ -36,8 +36,13 @@ namespace swbf { template inline void fprint(std::FILE* file, std::string_view format, Args&&... args) { #ifdef _WIN32 + // windows vt handling is DOG slow. don't know why lmao auto str = std::vformat(format, std::make_format_args(args...)); - WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), str.data(), str.length(), nullptr, nullptr); + HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); + if(file == stderr) + handle = GetStdHandle(STD_ERROR_HANDLE); + + WriteConsole(handle, str.data(), str.length(), nullptr, nullptr); #else std::vformat_to(FputcIterator(file), format, std::make_format_args(args...)); #endif