On 12/24/2022 5:36 PM, Jim Porter wrote: > I'll also see if I can fix the FIXME comment I added, but this is a part > of Eshell that's fairly brittle, and I think the *real* fix for that is > moving to running Eshell commands in a separate thread, as discussed on > emacs-devel. Ok, it turns out that the regression test that was failing (eshell-tests/queue-input) wasn't testing the right thing, so I've fixed that and also found a real bug in the queued-input code. The FIXME comment is now resolved, although I admit I'm not 100% sure why it helped improve things. I still don't entirely understand 'eshell-do-eval's inner workings... I also added an assertion to make sure we're not trying to close I/O handles more times than we should, which revealed another bug (this time with my patch), so I've fixed that too. I think this should resolve all the issues now, so unless anyone has objections, I'll merge this to the master branch in a few days.