From eab748343199252692622e1a4f3f3b3e356cc182 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Fri, 4 May 2018 20:01:49 +0200 Subject: [PATCH] Do not buffer stdout when rawtherapee.exe is called from msys2 console, fixes #4535 --- rtgui/main.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rtgui/main.cc b/rtgui/main.cc index 8ba7fb213..327b0ab33 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -468,6 +468,12 @@ int main (int argc, char **argv) Glib::init(); // called by Gtk::Main, but this may be important for thread handling, so we call it ourselves now Gio::init (); +#ifdef WIN32 + if (GetFileType (GetStdHandle (STD_OUTPUT_HANDLE)) == 0x0003) { + // started from msys2 console => do not buffer stdout + setbuf(stdout, NULL); + } +#endif #ifdef BUILD_BUNDLE char exname[512] = {0};