Subject: Re: bug#79079: 31.0.50; Piped command output is sometimes lost in Eshell

From: Eli Zaretskii <[email-masked]>
Date: Thu, 24 Jul 2025 17:56:35 +0300

> Date: Thu, 24 Jul 2025 06:52:39 -0700
> Cc: [email-masked], [email-masked],
>  Jim Porter <[email-masked]>
> From: Paul Eggert <[email-masked]>
> 
> >> I think in this case, we'd just want to let the rest of our code handle
> >> deactivating the process in the usual way. That helps fix this bug, plus
> >> I think it makes sense in general. If a process closes stdin, I believe
> >> we'd get the EPIPE error, but that process might want to continue
> >> working (though it does mean that you could only interact with that
> >> process via signaling it).
> 
> Yes, that makes sense.
> 
> 
> > What about calling the filter with the data we still have?  Isn't that
> > what a Posix shell would do -- flush any buffers?
> 
> Not sure what you man by that, but I suspect it wouldn't handle the 
> scenario Jim describes, where the other process closes its end of the 
> pipe but keeps running. Emacs shouldn't assume that EPIPE means the 
> other process has died or has closed any pipes other than the one Emacs 
> got EPIPE on.

I guess I'm confused: if the other process closed its end of the pipe,
why do we care about the stuff we have in our buffers that wasn't yet
piped to that other process?