Subject: Re: bug#71049: async-shell-command ends with "Process *Async Shell Command* finished" when remote "direct-async-process"

From: Michael Albinus <[email-masked]>
Date: Wed, 29 May 2024 19:42:24 +0200

Dmitry Gutov <[email-masked]> writes:

> Okay, to summarize the previous messages:

Thanks. For Eli, I summarize the essential of my proposal.

> async-shell-command calls shell-mode, which loads the history file by
> calling comint-read-input-ring.
>
> shell-setup-input-ring.diff extracts the comint input ring setup to a
> separate function. That function is then only called by 'shell', but
> not by 'shell-mode' itself anymore, or any of its descendants. Any
> callers or descendants of it that actually need this setup (I'm not
> aware of any, but they might exist) will need to adapt by adding this
> call.
>
> shell-no-start-prog.diff does not move the logic, but predicates its
> execution on the value of the variable shell--start-prog being
> non-nil. In-tree it's only set by 'shell', so the result is the
> same. The "how to adapt" recipe would be setting shell--start-prog to
> non-nil (in callers).

shell-mode is changed to obey the existing tramp-histfile-override in
the remote case, which tells whether to use the default history file,
another history file (you can give the file name), or to suppress the
history file at all. Like many Tramp methods, you can customize it via
connection-local variables. I made also the proposal to suppress reading
the remote history file for shell-command by default (performance!);
every user can change the config of course.

Best regards, Michael.