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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 25 Jul 2025 09:42:02 +0300

> Date: Thu, 24 Jul 2025 10:05:50 -0700
> Cc: [email-masked], [email-masked]
> From: Jim Porter <[email-masked]>
> 
> --- a/src/process.c
> +++ b/src/process.c
> @@ -6873,10 +6873,13 @@ send_process (Lisp_Object proc, const char *buf, ptrdiff_t len,
>  		}
>  	      else if (errno == EPIPE)
>  		{
> -		  p->raw_status_new = 0;
> -		  pset_status (p, list2 (Qexit, make_fixnum (256)));
> -		  p->tick = ++process_tick;
> -		  deactivate_process (proc);
> +		  /* FIXME: Handle PTY too?  What about sockets?  And
> +		     remove this debug statement.  */
> +		  AUTO_STRING (format, "[debug] EPIPE: %S");
> +		  CALLN (Fmessage, format, p->name);
> +
> +		  close_process_fd(&p->open_fd[WRITE_TO_SUBPROCESS]);
> +		  p->outfd = -1;
>  		  error ("Process %s no longer connected to pipe; closed it",
>  			 SDATA (p->name));
>  		}

Why do we need to emit a message about EPIPE, when we will immediately
signal an error with the same information?  The message will not be
seen by users except if they look in *Messages*.