summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-11-21 14:49:54 +0100
committerMichael Albinus <michael.albinus@gmx.de>2022-11-21 14:49:54 +0100
commit61e96789ddb1fe81520c3b1cc6c7ff43da5bc26f (patch)
tree037f438720579fedeac84cda0ab0fc0ca7675919 /lisp/net
parenta3b654e069e563b0a2a6335ec310ada51400ac09 (diff)
downloademacs-61e96789ddb1fe81520c3b1cc6c7ff43da5bc26f.tar.gz
emacs-61e96789ddb1fe81520c3b1cc6c7ff43da5bc26f.tar.bz2
emacs-61e96789ddb1fe81520c3b1cc6c7ff43da5bc26f.zip
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'.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp-container.el3
-rw-r--r--lisp/net/tramp.el14
2 files changed, 14 insertions, 3 deletions
diff --git a/lisp/net/tramp-container.el b/lisp/net/tramp-container.el
index 328625b7765..7b942532267 100644
--- a/lisp/net/tramp-container.el
+++ b/lisp/net/tramp-container.el
@@ -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"))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b08bc63e8a2..e9f30bea7bf 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -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