revert and refactor
This commit is contained in:
+14
-14
@@ -46,14 +46,14 @@
|
||||
|
||||
(defgroup incus-tramp nil
|
||||
"TRAMP integration for Incus."
|
||||
:group 'tramp)
|
||||
:group 'tramp
|
||||
:prefix "incus-tramp-")
|
||||
|
||||
(defcustom incus-tramp-incus-program "incus"
|
||||
"Path to the Incus executable."
|
||||
(defcustom incus-tramp-program "incus"
|
||||
"The executable name for Incus CLI"
|
||||
:type 'string
|
||||
:group 'incus-tramp)
|
||||
|
||||
;;;###autoload
|
||||
(defconst incus-tramp-method "incus"
|
||||
"Tramp method name to connect to Incus containers.")
|
||||
|
||||
@@ -67,17 +67,17 @@
|
||||
(defun incus-tramp-enable-method ()
|
||||
(with-eval-after-load 'tramp
|
||||
(add-to-list 'tramp-methods
|
||||
(incus-tramp-method
|
||||
(tramp-login-program incus-tramp-incus-program)
|
||||
(tramp-login-args (("exec") ("%h") ((format "--env TERM=%s" tramp-terminal-type)) ("--") ("%l")))
|
||||
(tramp-direct-async (tramp-default-remote-shell "-c"))
|
||||
(tramp-remote-shell tramp-default-remote-shell)
|
||||
(tramp-remote-shell-login ("-l"))
|
||||
(tramp-remote-shell-args ("-i" "-c"))
|
||||
(tramp-completion-use-cache nil)
|
||||
(tramp-connection-timeout 60)))
|
||||
`(,incus-tramp-method
|
||||
(tramp-login-program ,incus-tramp-program)
|
||||
(tramp-login-args (("exec") ("%h") (,(format "--env TERM=%s" tramp-terminal-type)) ("--") ("%l")))
|
||||
(tramp-direct-async "/bin/sh")
|
||||
(tramp-remote-shell "/bin/sh")
|
||||
(tramp-remote-shell-login ("-l"))
|
||||
(tramp-remote-shell-args ("-i" "-c"))
|
||||
(tramp-completion-use-cache nil)
|
||||
(tramp-connection-timeout 60)))
|
||||
(tramp-set-completion-function incus-tramp-method
|
||||
((tramp-incus-completion-function incus-tramp-method)))
|
||||
`((tramp-incus-completion-function ,incus-tramp-method)))
|
||||
(add-to-list 'tramp-completion-multi-hop-methods incus-tramp-method)))
|
||||
|
||||
(provide 'incus-tramp)
|
||||
|
||||
Reference in New Issue
Block a user