https://bugs.winehq.org/show_bug.cgi?id=56459
--- Comment #5 from renatopereyra@google.com --- Thanks for debugging this, Eric! I'm sorry I took a while to get back to you.
./wine [[your exec and args]] < /dev/null 2>&1 | cat -
This worked locally whenever the app does not have a console. 1) Is there a way to get the output to (also) print to the Linux side even when there is a console? 2 It seems a bit unsafe to rely on this long-term. Is there or could there be some kind of test in Wine that protects this kind of use/behavior?
submitted https://gitlab.winehq.org/wine/wine/-/merge_requests/5462 that should take care of the buffering with 4096 bytes of stderr.
I rebuilt the test app I shared but had it print to stdout instead of stderr. On Windows, when there was no console allocated, I found that if the prints came from a subprocess, they were always routed to stderr, even if the subprocess was supposedly printing to stdout. If the prints were done in the process called from the Windows command prompt, the output would go to stdout as expected.
It seems you already found this but, to confirm, I found that stdout appears buffered in a 4096-byte buffer. This meant that subprocess prints were never buffered (since they came in on stderr) but prints from the main process did get buffered.