From: Michael Albinus Date: Fri, 14 Feb 2025 14:21:30 +0000 (+0100) Subject: Adapt PuTTY integration into Tramp X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=385489d481e28c520018d66e6f0575076ea98f82;p=emacs.git Adapt PuTTY integration into Tramp * doc/misc/tramp.texi (Inline methods, External methods): PuTTY must be at least version 0.82. * lisp/net/tramp-cache.el (with-tramp-saved-connection-property) (with-tramp-saved-connection-properties): Add traces. * lisp/net/tramp-sh.el (tramp-methods) : Adapt `tramp-login-args' and `tramp-copy-args' arguments. (Bug#75746) (cherry picked from commit 9ded6fd73e929977a38d4c644aa4e9fe66e76e90) --- diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 941029a8ffc..467bc7d35a2 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -955,9 +955,10 @@ This is another method from the Kerberos suite. It behaves like @cindex @option{plink} method @item @option{plink} -@option{plink} method is for MS Windows users with the PuTTY -implementation of SSH@. It uses @samp{plink -ssh} to log in to the -remote host. It supports changing the remote login shell @command{/bin/sh}. +@option{plink} method is for MS Windows users with the +PuTTY@footnote{It requires at least PuTTY 0.82.} implementation of +SSH@. It uses @samp{plink -ssh} to log in to the remote host. It +supports changing the remote login shell @command{/bin/sh}. Check the @samp{Share SSH connections if possible} control for that session. @@ -1180,7 +1181,8 @@ This method supports the @samp{-p} argument. These methods are similar to @option{scp} or @option{sftp}, but they use the @command{plink} command to connect to the remote host, and they use @command{pscp} or @command{psftp} for transferring the files. -These programs are part of PuTTY, an SSH implementation for MS Windows. +These programs are part of PuTTY@footnote{It requires at least PuTTY +0.82.}, an SSH implementation for MS Windows. They support changing the remote login shell @command{/bin/sh}. diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el index 5794d1c2915..64f14c46db6 100644 --- a/lisp/net/tramp-cache.el +++ b/lisp/net/tramp-cache.el @@ -482,8 +482,10 @@ used to cache connection properties of the local machine." (hash (tramp-get-hash-table key)) (cached (and (hash-table-p hash) (gethash ,property hash tramp-cache-undefined)))) + (tramp-message key 7 "Saved %s %s" property cached) (unwind-protect (progn ,@body) ;; Reset PROPERTY. Recompute hash, it could have been flushed. + (tramp-message key 7 "Restored %s %s" property cached) (setq hash (tramp-get-hash-table key)) (if (not (eq cached tramp-cache-undefined)) (puthash ,property cached hash) @@ -501,8 +503,10 @@ PROPERTIES is a list of file properties (strings)." (lambda (property) (cons property (gethash property hash tramp-cache-undefined))) ,properties))) + (tramp-message key 7 "Saved %s" values) (unwind-protect (progn ,@body) ;; Reset PROPERTIES. Recompute hash, it could have been flushed. + (tramp-message key 7 "Restored %s" values) (setq hash (tramp-get-hash-table key)) (dolist (value values) (if (not (eq (cdr value) tramp-cache-undefined)) diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 805e23440e6..24e27a102de 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -322,6 +322,8 @@ The string is used in `tramp-methods'.") `("plink" (tramp-login-program "plink") (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c") + ;; Since PuTTY 0.82. + ("-legacy-stdio-prompts") ("-t") ("%h") ("\"") (,(format "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" @@ -335,6 +337,8 @@ The string is used in `tramp-methods'.") `("plinkx" (tramp-login-program "plink") (tramp-login-args (("-load") ("%h") ("%c") ("-t") ("\"") + ;; Since PuTTY 0.82. + ("-legacy-stdio-prompts") (,(format "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" tramp-terminal-type @@ -347,6 +351,8 @@ The string is used in `tramp-methods'.") `("pscp" (tramp-login-program "plink") (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c") + ;; Since PuTTY 0.82. + ("-legacy-stdio-prompts") ("-t") ("%h") ("\"") (,(format "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" @@ -358,6 +364,8 @@ The string is used in `tramp-methods'.") (tramp-remote-shell-args ("-c")) (tramp-copy-program "pscp") (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp") + ;; Since PuTTY 0.82. + ("-legacy-stdio-prompts") ("-p" "%k") ("-q") ("-r"))) (tramp-copy-keep-date t) (tramp-copy-recursive t))) @@ -365,6 +373,8 @@ The string is used in `tramp-methods'.") `("psftp" (tramp-login-program "plink") (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c") + ;; Since PuTTY 0.82. + ("-legacy-stdio-prompts") ("-t") ("%h") ("\"") (,(format "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" @@ -376,6 +386,8 @@ The string is used in `tramp-methods'.") (tramp-remote-shell-args ("-c")) (tramp-copy-program "pscp") (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp") + ;; Since PuTTY 0.82. + ("-legacy-stdio-prompts") ("-p" "%k"))) (tramp-copy-keep-date t)))