1 Commits

Author SHA1 Message Date
mdnight a2e7164bfd unquote incus-tramp-incus-program in tramp-methods definitions 2026-05-22 00:57:15 +00:00
2 changed files with 10 additions and 8 deletions
+1
View File
@@ -15,6 +15,7 @@ similarly to how it is implemented for Docker, Podman, and other programs.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package incus-tramp (use-package incus-tramp
:ensure nil
:after tramp :after tramp
:vc (incus-tramp :url "https://github.com/mdnight/incus-tramp.git" :vc (incus-tramp :url "https://github.com/mdnight/incus-tramp.git"
:rev "v0.1.0") :rev "v0.1.0")
+9 -8
View File
@@ -46,14 +46,14 @@
(defgroup incus-tramp nil (defgroup incus-tramp nil
"TRAMP integration for Incus." "TRAMP integration for Incus."
:group 'tramp :group 'tramp)
:prefix "incus-tramp-")
(defcustom incus-tramp-program "incus" (defcustom incus-tramp-incus-program "incus"
"The executable name for Incus CLI" "Path to the Incus executable."
:type 'string :type 'string
:group 'incus-tramp) :group 'incus-tramp)
;;;###autoload
(defconst incus-tramp-method "incus" (defconst incus-tramp-method "incus"
"Tramp method name to connect to Incus containers.") "Tramp method name to connect to Incus containers.")
@@ -64,14 +64,15 @@
(names (split-string raw-list "\n" 'omit))) (names (split-string raw-list "\n" 'omit)))
(mapcar (lambda (name) (list nil name)) names)))) (mapcar (lambda (name) (list nil name)) names))))
;;;###autoload
(defun incus-tramp-enable-method () (defun incus-tramp-enable-method ()
(with-eval-after-load 'tramp (with-eval-after-load 'tramp
(add-to-list 'tramp-methods (add-to-list 'tramp-methods
`(,incus-tramp-method `(incus-tramp-method
(tramp-login-program ,incus-tramp-program) (tramp-login-program incus-tramp-incus-program)
(tramp-login-args (("exec") ("%h") (,(format "--env TERM=%s" tramp-terminal-type)) ("--") ("%l"))) (tramp-login-args (("exec") ("%h") (,(format "--env TERM=%s" tramp-terminal-type)) ("--") ("%l")))
(tramp-direct-async "/bin/sh") (tramp-direct-async (,tramp-default-remote-shell "-c"))
(tramp-remote-shell "/bin/sh") (tramp-remote-shell ,tramp-default-remote-shell)
(tramp-remote-shell-login ("-l")) (tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-i" "-c")) (tramp-remote-shell-args ("-i" "-c"))
(tramp-completion-use-cache nil) (tramp-completion-use-cache nil)