]> git.eshelyaron.com Git - emacs.git/commit
Fix command replacement with the Eshell builtin versions of "sudo" and "doas"
authorJim Porter <jporterbugs@gmail.com>
Thu, 25 Jan 2024 02:32:00 +0000 (18:32 -0800)
committerEshel Yaron <me@eshelyaron.com>
Wed, 31 Jan 2024 20:09:39 +0000 (21:09 +0100)
commitbbc30ff149453962c6b5290e167a8a333994d472
treedfb6af4a86a75f0c0146aadf4e0570fe89eeef7d
parent1f86dd6dea3de6c494ba0347babd7933b023ea55
Fix command replacement with the Eshell builtin versions of "sudo" and "doas"

This is particularly important when the inner command to execute is an
alias.  Aliases throw 'eshell-replace-command' too, so we want to do
this in two phases: first, replace the "sudo"/"doas" with a
let-binding of 'default-directory', and then later, let the alias code
do its own replacement (bug#68074).

* lisp/eshell/em-tramp.el (eshell/sudo, eshell/doas): Use
'eshell-replace-command' to wrap the inner command.
* test/lisp/eshell/em-tramp-tests.el (mock-eshell-named-command):
Remove.
(em-tramp-test/sudo-basic, em-tramp-test/sudo-user)
(em-tramp-test/doas-basic, em-tramp-test/doas-user): Catch
'eshell-replace-command'.

(cherry picked from commit 3c680968e492acf8891fda22c28baef5078ca768)
lisp/eshell/em-tramp.el
test/lisp/eshell/em-tramp-tests.el