Skip to content

Commit 4fe961f

Browse files
add buffer flush before direct write
1 parent 8dbae41 commit 4fe961f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/fmt/format-inl.h

+1
Original file line numberDiff line numberDiff line change
@@ -1434,6 +1434,7 @@ extern "C" __declspec(dllimport) int __stdcall WriteConsoleW( //
14341434
FMT_FUNC bool write_console(std::FILE* f, string_view text) {
14351435
int fd = _fileno(f);
14361436
if (!_isatty(fd)) return false;
1437+
std::fflush(f);
14371438
auto u16 = utf8_to_utf16(text);
14381439
return WriteConsoleW(reinterpret_cast<void*>(_get_osfhandle(fd)), u16.c_str(),
14391440
static_cast<dword>(u16.size()), nullptr, nullptr) != 0;

0 commit comments

Comments
 (0)