Subject: Re: bug#48129: 28.0.50; Per file-handle (stdin, stdout and stderr) process-connection-type variable

From: Eli Zaretskii <[email-masked]>
Date: Sat, 12 Jun 2021 18:31:56 +0300

> Date: Sat, 12 Jun 2021 16:23:29 +0200
> CC: <[email-masked]>
> From: Thomas Hisch <[email-masked]>
> 
> > Eli Zaretskii <[email-masked]> writes:
> >
> >> If it's possible to solve your problem by using make-pipe-process, I'd
> >> prefer such a solution.  Introducing yet another obscure option to
> >> make-process should best be avoided, IMO.
> 
> Yes I agree, if I could use make-pipe-process I would use it, but I
> guess it doesn't work.
> 
> 
> (let* ((stderr-buffer (get-buffer-create "*stderr*"))
>         (stderr-pipe-proc (make-pipe-process :name "stderr"
>                                              :buffer stderr-buffer))
>         (stdout-buffer (get-buffer-create "*temp*")))
>      (make-process
>       :name "isatty"
>       ;; what do I want?
>       ;; I want stdin to be connected to a pty but not stdout
>       :buffer stdout-buffer
>       :connection-type 'pty
>       :stderr stderr-pipe-proc
>       :command (list "/tmp/output-isatty.py")))
> 
> What have I tried:
> 
> * toggling the connection-type arguement doesn't have any impact on the
> output of the python script, which is run as a subprocess.
> 
> * if a stderr argument is passed to make-process and the value is a the
> pipe-process, then both stdin as well as stdout in the subprocess are
> connected non-pty devices
> 
> * if a stderr argument is not passed to make-process, then both stdin as
> well as stdout in the subprocess are connected to pty devices.

Indeed, I forgot that using :stderr with make-process automatically
resets the process connection typ to use pipes for all the 3 standard
handles.  I guess there's some technical issue underlying that?
Because we had that restriction since day one.  Perhaps using PTYs
means that stderr must be redirected to the same device as stdout or
something?