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.

Full log


View this message in rfc822 format

From: Jim Porter <jporterbugs <at> gmail.com>
To: 55620 <at> debbugs.gnu.org
Subject: bug#55620: 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...




This bug report was last modified 3 years and 1 day ago.

Previous Next


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