diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f0fd7867..c082fa0c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Logos: Bugfixes: * `--logo-type` now does accept `iterm` too (@CarterLi, #374) * Fix mintty terminal font detection +* Fix bug that line buffering doesn't work properly (Windows) Other: * Fixed a Typo in iterm error message (@jessebot, #376) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4abd15ffb..fc0451893 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -645,7 +645,6 @@ if(ENABLE_THREADS) endif() endif() - if(ENABLE_BUFFER) target_compile_definitions(libfastfetch PRIVATE FF_ENABLE_BUFFER) endif() @@ -720,6 +719,11 @@ target_link_libraries(flashfetch PRIVATE libfastfetch ) +if(ENABLE_BUFFER) # FF_ENABLE_BUFFER is used in fastfetch.c + target_compile_definitions(fastfetch PRIVATE FF_ENABLE_BUFFER) + target_compile_definitions(flashfetch PRIVATE FF_ENABLE_BUFFER) +endif() + if(WIN32) set(TARGET_NAME fastfetch) target_sources(fastfetch diff --git a/src/fastfetch.c b/src/fastfetch.c index 6013a6daa..0e8fb855c 100644 --- a/src/fastfetch.c +++ b/src/fastfetch.c @@ -1482,6 +1482,10 @@ int main(int argc, const char** argv) ffStart(&instance); + #if defined(_WIN32) && defined(FF_ENABLE_BUFFER) + fflush(stdout); + #endif + //Parse the structure and call the modules uint32_t startIndex = 0; while (startIndex < data.structure.length)