From 043778da0a35f2949d4fd504f0f1ad9791f37c9d Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Wed, 5 Jul 2023 09:24:21 -0700 Subject: [PATCH] Fixed a bug in my eshell starter function --- ha-eshell.org | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ha-eshell.org b/ha-eshell.org index dff68d7..b575d99 100644 --- a/ha-eshell.org +++ b/ha-eshell.org @@ -1453,14 +1453,14 @@ Tramp reference can be long when attempting to connect as another user account u (defun ha-eshell-host->tramp (username hostname &optional prefer-root) "Return a TRAMP reference based on a USERNAME and HOSTNAME that refers to any host or IP address." - (cond ((string-match-p "^/" host) - host) + (cond ((string-match-p "^/" hostname) + hostname) ((or (and prefer-root (not username)) (equal username "root")) (format "/ssh:%s|sudo:%s:" hostname hostname)) ((or (null username) (equal username user-login-name)) (format "/ssh:%s:" hostname)) (t - (format "/ssh:%s|sudo:%s|sudo@%s:%s:" hostname hostname username hostname)))) + (format "/ssh:%s@%s:" username hostname)))) #+end_src This function pulls it all together: