[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#55620: 29.0.50; Eshell doesn't reset `eshell-in-pipeline-p' in subco
From: |
Jim Porter |
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...
- bug#55620: 29.0.50; Eshell doesn't reset `eshell-in-pipeline-p' in subcommands,
Jim Porter <=