GNU bug report logs - #25270
eshell -- programmatically send input -- feature request

Previous Next

Package: emacs;

Reported by: Keith David Bershatsky <esq <at> lawlist.com>

Date: Sun, 25 Dec 2016 19:02:01 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Jim Porter <jporterbugs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Keith David Bershatsky <esq <at> lawlist.com>, 25270 <at> debbugs.gnu.org
Subject: bug#25270: eshell -- programmatically send input -- feature request
Date: Mon, 16 May 2022 10:33:49 -0700
On 5/16/2022 5:13 AM, Lars Ingebrigtsen wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
>> Also, for the code posted in the original message, I'm not sure the
>> changes to `eshell-parse-command' are needed. It should already let
>> you pass a command string to it. Maybe this is because there's an
>> issue with how `eshell-parse-command' temporarily inserts COMMAND into
>> the buffer (see the FIXME comment in the code in the original
>> message)? If there is, we'd probably have to think quite a bit more
>> about how to resolve it.
> 
> Yes, if I understood correctly, that was the main problem -- inserting
> things into the buffer to eval it sometimes leaves artefacts (or doesn't
> work), so it'd be better to talk directly to the underlying shell to get
> things evalled.

I think for talking to Eshell itself, inserting things into the buffer 
(temporarily) should be ok. Eshell already does this (as of Emacs 29, I 
think) when parsing some complex commands. If you have some $-expansions 
inside double-quotes, e.g. 'echo "${echo \"hi there\"}"', Eshell 
temporarily inserts 'echo "hi there"' into the buffer to parse it, and 
then removes it before proceeding.

For sending input to a child process being run inside Eshell, we 
wouldn't do all this, since Eshell wouldn't be treating the input as an 
Eshell command to be parsed. In that case, we could just send the string 
to the child process directly (possibly with some extra Eshell bookkeeping).




This bug report was last modified 3 years and 30 days ago.

Previous Next


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