]> git.eshelyaron.com Git - emacs.git/commitdiff
Make usage of su and sudo consistent in eshell (bug#53783)
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 6 Feb 2022 08:43:13 +0000 (09:43 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 6 Feb 2022 08:43:13 +0000 (09:43 +0100)
* lisp/eshell/em-tramp.el (eshell/su, eshell/sudo):
Use `tramp-default-host' instead of "localhost".

lisp/eshell/em-tramp.el

index 2afd4fe066a4239954155634464f8a8364cae137..aebbc36e71dc4e4743ef1f29c25c263181fc8cbb 100644 (file)
@@ -71,7 +71,7 @@ Become another USER during a login session.")
    (throw 'eshell-replace-command
           (let ((user "root")
                 (host (or (file-remote-p default-directory 'host)
-                          "localhost"))
+                          tramp-default-host))
                 (dir (file-local-name (expand-file-name default-directory)))
                 (prefix (file-remote-p default-directory)))
             (dolist (arg args)
@@ -106,7 +106,7 @@ Execute a COMMAND as the superuser or another USER.")
    (throw 'eshell-external
           (let* ((user (or user "root"))
                  (host (or (file-remote-p default-directory 'host)
-                           "localhost"))
+                           tramp-default-host))
                  (dir (file-local-name (expand-file-name default-directory)))
                  (prefix (file-remote-p default-directory))
                  (default-directory