https://bugs.winehq.org/show_bug.cgi?id=56459
--- Comment #2 from renatopereyra@google.com --- Thanks for taking a look! I appreciate your help.
To move forward, could you please update your tests with:
- running your test under windows and mark where there's a difference from
Wine 9.0.
I updated the spreadsheet with outcomes from wineconsole and Windows. I found that wineconsole behaved the same as running Wine from a Linux terminal but Windows behaved a but differently, which seems like a bug. I highlighted the differences with red text.
most of potential issues are likely not really about "flushing" but around:
- (file) handle inheritance...
- several operations... happen to close handles...
Based on my testing on Windows, I think this is true in cases where there is no output written out anywhere at all (therefore, I renamed "no-flush" with "no-output" in the spreadsheet). However, there are cases in which Windows behaves similarly to Wine/wineconsole in principle but, in Windows, the characters are always flushed completely and at the time that they are written, rather than flushed in 4096-byte blocks like Wine does. In these cases, the results make me think that there really is a flushing problem.
- when testing on Unix, you should also consider two cases:
A) running from the Unix shell ... Results in A) have no equivalent under Windows, so we had to make compromises between the two worlds, yet we have more flexibility on what's possible or not.
My hope is that, when a process is invoked directly from the Linux terminal, we:
1. Independently ensure that any printfs are flushed out to the Linux terminal, regardless of whether they _also_ make it out to the wineconsole.
2. When a process is invoked through a Linux terminal, I/O redirection is processed by the Linux shell rather than Wine. In these cases Wine would behave as if there had been no I/O redirection requested. By extension, this would mean that I/O redirection only works like Windows does when used within wineconsole.
Combining #1 and #2 would mean that we can always get all output from a Windows program on the Linux side, regardless of Windows-style semantics, but only when a program is invoked from the Linux terminal. I'm not sure if this would break anything elsewhere but I think this would help developers while debugging because any errors logged by apps are always visible. Thoughts? Is this possible/sensible?