Activate direct asynchronous processes for Tramp container methods
* doc/misc/tramp.texi (Remote processes): Mention also tramp-container.el. * lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory): Add `tramp-direct-async' to "mock" method. * lisp/net/tramp-container.el (tramp-methods) <docker, podman, kubernetes>: Add `tramp-direct-async'. * lisp/net/tramp.el (tramp-methods): Adapt docstring. (tramp-handle-make-process): Handle `tramp-direct-async'. * test/lisp/net/tramp-tests.el (tramp-methods) <mock>: Add `tramp-direct-async'.
This commit is contained in:
parent
a3b654e069
commit
61e96789dd
5 changed files with 22 additions and 8 deletions
|
@ -4253,8 +4253,9 @@ Furthermore, this approach has the following limitations:
|
|||
|
||||
@itemize
|
||||
@item
|
||||
It works only for connection methods defined in @file{tramp-adb.el},
|
||||
@file{tramp-sh.el} and @file{tramp-sshfs.el}.
|
||||
It works only for some connection methods defined in
|
||||
@file{tramp-adb.el}, @file{tramp-container.el}, @file{tramp-sh.el} and
|
||||
@file{tramp-sshfs.el}.
|
||||
|
||||
@item
|
||||
It does not support interactive user authentication. With
|
||||
|
|
|
@ -560,6 +560,7 @@ The same keyword arguments are supported as in
|
|||
'("mock"
|
||||
(tramp-login-program "sh")
|
||||
(tramp-login-args (("-i")))
|
||||
(tramp-direct-async ("-c"))
|
||||
(tramp-remote-shell "/bin/sh")
|
||||
(tramp-remote-shell-args ("-c"))
|
||||
(tramp-connection-timeout 10)))
|
||||
|
|
|
@ -163,6 +163,7 @@ see its function help for a description of the format."
|
|||
("-u" "%u")
|
||||
("%h")
|
||||
("%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"))))
|
||||
|
@ -174,6 +175,7 @@ see its function help for a description of the format."
|
|||
("-u" "%u")
|
||||
("%h")
|
||||
("%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"))))
|
||||
|
@ -186,6 +188,7 @@ see its function help for a description of the format."
|
|||
("--")
|
||||
("%l")))
|
||||
(tramp-config-check tramp-kubernetes--current-context-data)
|
||||
(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"))))
|
||||
|
|
|
@ -278,8 +278,9 @@ pair of the form (KEY VALUE). The following KEYs are defined:
|
|||
|
||||
* `tramp-direct-async'
|
||||
Whether the method supports direct asynchronous processes.
|
||||
Until now, just \"ssh\"-based, \"sshfs\"-based and
|
||||
\"adb\"-based methods do.
|
||||
Until now, just \"ssh\"-based, \"sshfs\"-based, \"adb\"-based
|
||||
and container methods do. If it is a list of strings, they
|
||||
are used to construct the remote command.
|
||||
|
||||
* `tramp-config-check'
|
||||
A function to be called with one argument, VEC. It should
|
||||
|
@ -4804,7 +4805,14 @@ substitution. SPEC-LIST is a list of char/value pairs used for
|
|||
(command
|
||||
(append
|
||||
`("cd" ,(tramp-shell-quote-argument localname) "&&" "(" "env")
|
||||
env `(,command ")"))))
|
||||
env `(,command ")")))
|
||||
;; Add remote shell if needed.
|
||||
(command
|
||||
(if (consp (tramp-get-method-parameter v 'tramp-direct-async))
|
||||
(append
|
||||
(tramp-get-method-parameter v 'tramp-direct-async)
|
||||
`(,(mapconcat #'identity command " ")))
|
||||
command)))
|
||||
|
||||
;; Check for `tramp-sh-file-name-handler', because something
|
||||
;; is different between tramp-sh.el, and tramp-adb.el or
|
||||
|
|
|
@ -140,10 +140,11 @@ A resource file is in the resource directory as per
|
|||
((eq system-type 'windows-nt) null-device)
|
||||
(t (add-to-list
|
||||
'tramp-methods
|
||||
'("mock"
|
||||
(tramp-login-program "sh")
|
||||
`("mock"
|
||||
(tramp-login-program ,tramp-default-remote-shell)
|
||||
(tramp-login-args (("-i")))
|
||||
(tramp-remote-shell "/bin/sh")
|
||||
(tramp-direct-async ("-c"))
|
||||
(tramp-remote-shell ,tramp-default-remote-shell)
|
||||
(tramp-remote-shell-args ("-c"))
|
||||
(tramp-connection-timeout 10)))
|
||||
(add-to-list
|
||||
|
|
Loading…
Add table
Reference in a new issue