Subject: bug#15695: 24.3; multiple async shell commands at once run randomly

From: Noam Postavsky <[email-masked]>
Date: Mon, 02 Apr 2018 19:49:27 -0400

merge 15695 16019
quit

> If I set process-connection-type to nil, then I get expected results

> This problem is also talked about in [1] and [2].
>
> [1]: http://nullprogram.com/blog/2018/01/17/
> [2]: http://nullprogram.com/blog/2014/02/06/#pseudo-terminals

Actually, I don't think this bug is a problem of Emacs losing data after
all, it's just that the shell does the 'echo baz' and then usually exits
before the other echo commands get to run (when running with a pty,
Emacs sends SIGHUP to all child process in the terminal).  If I add a ";
wait" to the shell command, then I get

"baz\nbar\nfoo\n": 374
"baz\nfoo\nbar\n": 428
"foo\nbaz\nbar\n": 17
"bar\nfoo\nbaz\n": 1

which is as expected.  I'm merging with #16019 which is about Emacs
sending SIGHUP to all child processes of a pty subprocess.