GNU bug report logs - #61024
29.0.60; [PATCH] Eshell errors out when trying to redirect output of a remote process

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Mon, 23 Jan 2023 07:09:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.60

To reply to this bug, email your comments to 61024 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Mon, 23 Jan 2023 07:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Porter <jporterbugs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 23 Jan 2023 07:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.60; [PATCH] Eshell errors out when trying to redirect output of
 a remote process
Date: Sun, 22 Jan 2023 23:07:58 -0800
[Message part 1 (text/plain, inline)]
To see this in action, run "emacs -Q -f eshell" and then:

  ~ $ cd /sudo::
  /sudo:root <at> host:~ # *echo hi there > #<foo>
  Wrong type argument: "bufferp echo-stderr"

(Any other Tramp method should reproduce this issue.) That's because the 
echo command is being redirected to two places: stdout is going to the 
buffer "foo", and stderr is going to the Eshell buffer (via a pipe 
process). However, that doesn't work for Tramp processes.

Attached is a fix with a test. I think this should definitely go in 
Emacs 29, since it's a pretty bad regression. I'm actually surprised no 
one has filed a bug on this already.

For tracking purposes, I believe this was broken by f07505d1ec (bug#21605).

For Emacs 30, it'd be interesting to see if there were a way to get 
Tramp processes to have different targets for stdout and stderr. That'd 
make them work a lot more like local processes in Eshell.
[0001-Don-t-try-to-make-a-pipe-process-for-remote-processe.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Mon, 23 Jan 2023 13:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 61024 <at> debbugs.gnu.org
Subject: Re: bug#61024: 29.0.60;
 [PATCH] Eshell errors out when trying to redirect output of a remote
 process
Date: Mon, 23 Jan 2023 15:21:49 +0200
> Date: Sun, 22 Jan 2023 23:07:58 -0800
> From: Jim Porter <jporterbugs <at> gmail.com>
> 
>    ~ $ cd /sudo::
>    /sudo:root <at> host:~ # *echo hi there > #<foo>
>    Wrong type argument: "bufferp echo-stderr"
> 
> (Any other Tramp method should reproduce this issue.) That's because the 
> echo command is being redirected to two places: stdout is going to the 
> buffer "foo", and stderr is going to the Eshell buffer (via a pipe 
> process). However, that doesn't work for Tramp processes.
> 
> Attached is a fix with a test. I think this should definitely go in 
> Emacs 29, since it's a pretty bad regression.

Fine by me, unless Michael objects or has better ideas.

> I'm actually surprised no one has filed a bug on this already.

Maybe it tells us how many people use this combination?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Mon, 23 Jan 2023 15:51:02 GMT) Full text and rfc822 format available.

Message #11 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 61024 <at> debbugs.gnu.org, Jim Porter <jporterbugs <at> gmail.com>
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Mon, 23 Jan 2023 16:50:14 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

Hi,

>>    ~ $ cd /sudo::
>>    /sudo:root <at> host:~ # *echo hi there > #<foo>
>>    Wrong type argument: "bufferp echo-stderr"
>>
>> (Any other Tramp method should reproduce this issue.) That's because the
>> echo command is being redirected to two places: stdout is going to the
>> buffer "foo", and stderr is going to the Eshell buffer (via a pipe
>> process). However, that doesn't work for Tramp processes.
>>
>> Attached is a fix with a test. I think this should definitely go in
>> Emacs 29, since it's a pretty bad regression.
>
> Fine by me, unless Michael objects or has better ideas.

Pipe processes are always tricky for Tramp. I *believe* redirecting
stdout and stderr to different buffers shall work, see "test6" of
tramp-test30-make-process. But I remember also that this was painful to
implement and test.

>> I'm actually surprised no one has filed a bug on this already.
>
> Maybe it tells us how many people use this combination?

So do we want to reopen this can of worms, and see what happens with
Tramp? But perhaps it is a problem in Eshell, which tries to create its
own pipe process?

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Mon, 23 Jan 2023 17:48:01 GMT) Full text and rfc822 format available.

Message #14 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 61024 <at> debbugs.gnu.org
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Mon, 23 Jan 2023 09:47:03 -0800
On 1/23/2023 7:50 AM, Michael Albinus wrote:
> Pipe processes are always tricky for Tramp. I *believe* redirecting
> stdout and stderr to different buffers shall work, see "test6" of
> tramp-test30-make-process. But I remember also that this was painful to
> implement and test.

Yeah, I took a look at the Tramp code and it's pretty tricky. I'll see 
if I can come up with something for Emacs 30 though (maybe we could 
update the 'make-process' API to make this easier for Tramp?).

I'll merge this simple fix to Emacs 29 shortly then.

>>> I'm actually surprised no one has filed a bug on this already.
>>
>> Maybe it tells us how many people use this combination?
> 
> So do we want to reopen this can of worms, and see what happens with
> Tramp? But perhaps it is a problem in Eshell, which tries to create its
> own pipe process?

I'd certainly expect to see bug reports if this had shipped as part of a 
final Emacs release, but I think it does say that not many people use 
Tramp + Eshell on development builds. (Which, if anything, is mostly a 
sign to me that I need to be extra-careful when testing combinations of 
features like this, since people might not report bugs until after the 
release.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Mon, 23 Jan 2023 17:52:01 GMT) Full text and rfc822 format available.

Message #17 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Michael Albinus <michael.albinus <at> gmx.de>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 61024 <at> debbugs.gnu.org
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Mon, 23 Jan 2023 09:51:05 -0800
On 1/23/2023 9:47 AM, Jim Porter wrote:
> I'll merge this simple fix to Emacs 29 shortly then.

Ok, merged to Emacs 29 as 7f438ff543. I'll leave this open though so we 
can discuss a better fix for Emacs 30.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Mon, 23 Jan 2023 18:26:02 GMT) Full text and rfc822 format available.

Message #20 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 61024 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Mon, 23 Jan 2023 19:25:34 +0100
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

>> Pipe processes are always tricky for Tramp. I *believe* redirecting
>> stdout and stderr to different buffers shall work, see "test6" of
>> tramp-test30-make-process. But I remember also that this was painful to
>> implement and test.
>
> Yeah, I took a look at the Tramp code and it's pretty tricky. I'll see
> if I can come up with something for Emacs 30 though (maybe we could
> update the 'make-process' API to make this easier for Tramp?).

Pls do. Let's see where we land.

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Wed, 12 Feb 2025 03:06:01 GMT) Full text and rfc822 format available.

Message #23 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 61024 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Tue, 11 Feb 2025 19:05:43 -0800
Jim Porter <jporterbugs <at> gmail.com> writes:

> On 1/23/2023 9:47 AM, Jim Porter wrote:
>> I'll merge this simple fix to Emacs 29 shortly then.
>
> Ok, merged to Emacs 29 as 7f438ff543. I'll leave this open though so we can
> discuss a better fix for Emacs 30.

What is the latest here?  Did you come up with a better fix?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Fri, 21 Feb 2025 21:40:03 GMT) Full text and rfc822 format available.

Message #26 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 61024 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Michael Albinus <michael.albinus <at> gmx.de>
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Fri, 21 Feb 2025 13:39:15 -0800
On 2/11/2025 7:05 PM, Stefan Kangas wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
>> On 1/23/2023 9:47 AM, Jim Porter wrote:
>>> I'll merge this simple fix to Emacs 29 shortly then.
>>
>> Ok, merged to Emacs 29 as 7f438ff543. I'll leave this open though so we can
>> discuss a better fix for Emacs 30.
> 
> What is the latest here?  Did you come up with a better fix?

No, not yet. While it should be possible to do this, it's not easy and 
will require some likely very subtle changes to Tramp's remote process 
output redirection.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#61024; Package emacs. (Sat, 22 Feb 2025 10:12:02 GMT) Full text and rfc822 format available.

Message #29 received at 61024 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 61024 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Stefan Kangas <stefankangas <at> gmail.com>
Subject: Re: bug#61024: 29.0.60; [PATCH] Eshell errors out when trying to
 redirect output of a remote process
Date: Sat, 22 Feb 2025 11:11:26 +0100
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

>>> Ok, merged to Emacs 29 as 7f438ff543. I'll leave this open though so we can
>>> discuss a better fix for Emacs 30.
>> What is the latest here?  Did you come up with a better fix?
>
> No, not yet. While it should be possible to do this, it's not easy and
> will require some likely very subtle changes to Tramp's remote process
> output redirection.

I guess you'll contact me if changes in Tramp are needed.

Best regards, Michael.




This bug report was last modified 114 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.