Unbuffered I/O breaks some valid usages #7836
Example of the behaviour:
Yes, the other issue is that the command does not fail and ends with
The change to unbuffered I/O was done because of #3748. Even though I could argue that it makes the shell behave unexpectedly and that issue could've been fixed differently, I think it would be enough if the writes were buffered when being redirected as that could, probably, deal with most issue possibly arising from this.
The text was updated successfully, but these errors were encountered:
Hahaha, yeah, running
I'm not entirely sure what the general buffering strategy here should be - chunking seems faster, but can lead to weird results. However,
Given that this was changed in 2.6, four years ago, I'm removing the "regression" label. It's not, in a practical sense, something that's changed recently.
`streams.out.push_back` for fd_streams_t writes to the fd *immediately*. We might want to introduce a general buffering strategy, but in this case writing it in one go is the simplest and seems acceptable - we already have constrained the argument size, so just pushing it out should work well enough. See #7836
Alright, I've changed this for
They will, however, append a newline or space separately with something like
The best chunking strategy I can come up with here is something like "after newline or every 512 bytes" (or some other power-of-2).