fix(vertico): consult-dir: don't guess user from containers
The tramp string used to connect to the container uses the first `container-runtime ps` argument as a username, but the first argument returned is the container ID, not a username. Close: #7674 Co-authored-by: bergmannf <bergmannf@users.noreply.github.com> Co-authored-by: elken <elken@users.noreply.github.com>
This commit is contained in:
parent
73f19acb66
commit
d22fa5a670
1 changed files with 3 additions and 5 deletions
|
@ -201,7 +201,8 @@ orderless."
|
|||
("C-x C-j" . consult-dir-jump-file))
|
||||
:config
|
||||
(when (modulep! :tools docker)
|
||||
;; TODO Replace with `tramp-container--completion-function' when we drop support for <29
|
||||
;; TODO: Replace with `tramp-container--completion-function' when we drop
|
||||
;; support for <29
|
||||
(defun +vertico--consult-dir-container-hosts (host)
|
||||
"Get a list of hosts from HOST."
|
||||
(cl-loop for line in (cdr
|
||||
|
@ -209,10 +210,7 @@ orderless."
|
|||
(apply #'process-lines +vertico-consult-dir-container-executable
|
||||
(append +vertico-consult-dir-container-args (list "ps")))))
|
||||
for cand = (split-string line "[[:space:]]+" t)
|
||||
collect (let ((user (unless (string-empty-p (car cand))
|
||||
(concat (car cand) "@")))
|
||||
(hostname (car (last cand))))
|
||||
(format "/%s:%s%s:/" host user hostname))))
|
||||
collect (format "/%s:%s:/" host (car (last cand)))))
|
||||
|
||||
(defun +vertico--consult-dir-podman-hosts ()
|
||||
(let ((+vertico-consult-dir-container-executable "podman"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue