GNU bug report logs - #55620
29.0.50; Eshell doesn't reset `eshell-in-pipeline-p' in subcommands

Previous Next

Package: emacs;

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

Date: Wed, 25 May 2022 02:22:02 UTC

Severity: normal

Found in version 29.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 55620 in the body.
You can then email your comments to 55620 AT debbugs.gnu.org in the normal way.

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#55620; Package emacs. (Wed, 25 May 2022 02:22: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. (Wed, 25 May 2022 02:22: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.50; Eshell doesn't reset `eshell-in-pipeline-p' in subcommands
Date: Tue, 24 May 2022 19:20:59 -0700
From `emacs -Q -f eshell':

  ~ $ echo $eshell-in-pipeline-p
  ;; no output
  ~ $ echo ${echo $eshell-in-pipeline-p}
  ;; no output
  ~ $ echo ${echo $eshell-in-pipeline-p} | cat
  first

(Note: in the first two cases, `eshell-in-pipeline-p' is nil, so there's 
no output.) The last case is surprising: it's true that the inner `echo' 
invocation is in a pipeline, but the pipeline is a level above it 
(`first' means that when `eshell-in-pipeline-p' was evaluated, it was 
the first command in a pipeline). Since the inner `echo' is effectively 
in a subshell, it makes more sense for the value of 
`eshell-in-pipeline-p' to be nil for the last case.

While this is a seemingly-obscure issue, there is one practical effect 
that might bite users: currently, the Eshell implementation of `cat' 
only works when *not* in a pipeline. Usually, it'll just fall back to 
using the real system `cat' program if the Eshell version doesn't work, 
but on systems without `cat' (e.g. MS Windows), you get the following error:

  ~ $ echo ${cat file.txt} | echo
  Eshell’s ‘cat’ does not work in pipelines

Patch forthcoming momentarily; just getting a bug number...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55620; Package emacs. (Wed, 25 May 2022 03:38:01 GMT) Full text and rfc822 format available.

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

From: Jim Porter <jporterbugs <at> gmail.com>
To: 55620 <at> debbugs.gnu.org
Subject: Re: bug#55620: [PATCH] 29.0.50; Eshell doesn't reset
 `eshell-in-pipeline-p' in subcommands
Date: Tue, 24 May 2022 20:37:01 -0700
[Message part 1 (text/plain, inline)]
(Originally mis-sent with the wrong email address.)

Attached is a patch with tests to fix this. Note that I reset 
`eshell-in-pipeline-p' in two places:

1. `eshell-subcommand-bindings': This handles any case where a 
subcommand is invoked. This can happen with the following syntaxes: 
{CMD}, ${CMD}, and $<CMD>.

2. `eshell-command-to-value': This handles cases where a command is run 
synchronously. This can happen with some of the syntaxes mentioned 
above: {CMD} and ${CMD}. However, it can also happen for Lisp forms like 
(LISP) and $(LISP). (Most Lisp forms aren't likely to consult 
`eshell-in-pipeline-p', but if you were calling an Eshell built-in 
command using Lisp syntax, you might run into this issue.)
[0001-Reset-eshell-in-pipeline-p-when-interpolating-comman.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#55620; Package emacs. (Wed, 25 May 2022 12:14:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 55620 <at> debbugs.gnu.org
Subject: Re: bug#55620: 29.0.50; Eshell doesn't reset `eshell-in-pipeline-p'
 in subcommands
Date: Wed, 25 May 2022 14:13:44 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

> Attached is a patch with tests to fix this. Note that I reset
> `eshell-in-pipeline-p' in two places:

Thanks; pushed to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 55620 <at> debbugs.gnu.org and Jim Porter <jporterbugs <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 25 May 2022 12:14:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 23 Jun 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 307 days ago.

Previous Next


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