To be clear, I'm not talking about anything that should require emacs to be multithreaded (though that would probably also solve this). To reproduce:
- emacs -Q # I'm running 24.4.1
- Make a second frame
- Switch back to first frame
- M-x shell
- M-x rename-uniquely (we're going to make a second shell later)
- Start running:
while true; do echo "hello world"; done
- In the second frame, M-x shell
The second shell will almost never display (rarely it works after repeated attempts). Apparently emacs will never take a break from reading the output of the first shell to listen to the output coming in from any other process. It would be much better behavior for it to round robin when there are multiple processes with pending output. Is there any way to get better behavior?
The only trick I know would be to make the shell buffer its own process, but unfortunately that won't work for me. Even if I do that, I have to run a subprocess to listen to a socket for my speech recognition software to work so that I can actually control the shell in the first place, that's how I discovered this; running an infinite loop like the above prevents any data from being taken off the socket.