Subject: Re: bug#41788: 28.0.50; emacsclient -t doesn't work with vipe from moreutils

From: Andreas Schwab <[email-masked]>
Date: Mon, 06 Jun 2022 16:44:15 +0200

On Jun 06 2022, Lars Ingebrigtsen wrote:

> Platon Pronko <[email-masked]> writes:
>
>> $ echo a | EDITOR='emacsclient -t' vipe
>> *ERROR*: Could not open file: /dev/tty
>> emacsclient -t exited nonzero, aborting
>>
>> (vipe is a tool from moreutils, used to insert an editor in the middle of
>> the pipeline)
>>
>> Looking inside vipe source I see that it reopens stdin before calling
>> the EDITOR:
>>
>> close STDIN;
>> open(STDIN, "</dev/tty") || die "reopen stdin: $!";
>>
>> If I use for example nano instead of emacsclient -t then everything works correctly.
>
> (I'm going through old bug reports that unfortunately weren't resolved
> at the time.)
>
> This problem is still present in Emacs 29.  Does anybody understand
> where the misbehaviour between this STDIN redirect and what emacsclient
> is complaining about can be fixed?

It's not emacsclient that is complaining, it just displays the error
raised by emacs.  But it is hard to guess what's going on without
knowing the exact command line.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."