GNU bug report logs -
#55590
29.0.50; Eshell subcommands clobber pipelines and produce incorrect output
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Mon, 23 May 2022 03:36:01 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
[Message part 1 (text/plain, inline)]
On 5/22/2022 8:34 PM, Jim Porter wrote:
> Starting from `emacs -Q -f eshell', enter the following command:
>
> echo ${*echo hi} | rev
>
> The output is:
>
> ~ $ ih
>
> That is, the output of the command ended up *after* the prompt, when it
> should be before.
The attached patch fixes this issue. It might not be the *best* way to
do it, but it's the least-invasive I could come up with. The
`make-symbol' dance is a bit awkward, but Eshell already uses it for
`eshell-command-to-value' / `eshell-do-command-to-value', so hopefully
it's ok. I'm open to other solutions though. It's possible the bug is
really in `eshell-do-eval', since I'd expect the original code to work,
but `eshell-do-eval' is pretty tricky, and I don't want to poke at it
too hard for fear that other things will break.
Long-term, the best way to fix this might be to rip out `eshell-do-eval'
entirely, which iteratively evaluates parts of Eshell commands (so as
not to hang Emacs) and use the generator.el machinery instead. I looked
into that briefly, and it seems like it would be quite a bit of work.
And I don't fully understand generator.el's implementation yet anyway...
[0001-Keep-subcommands-in-pipelines-from-clobbering-the-he.patch (text/plain, attachment)]
This bug report was last modified 3 years and 58 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.