]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt PuTTY integration into Tramp
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 14 Feb 2025 14:21:30 +0000 (15:21 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 15 Feb 2025 19:30:28 +0000 (20:30 +0100)
* 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) <plink, plinkx, pscp, psftp>:
Adapt `tramp-login-args' and `tramp-copy-args' arguments.  (Bug#75746)

(cherry picked from commit 9ded6fd73e929977a38d4c644aa4e9fe66e76e90)

doc/misc/tramp.texi
lisp/net/tramp-cache.el
lisp/net/tramp-sh.el

index 941029a8ffc71ac65b9ab0e69940212c47e95325..467bc7d35a2e892341abaf2f023bfe51f0fd3c01 100644 (file)
@@ -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}.
 
index 5794d1c291511538e9de0da53e4ba751f6f554d4..64f14c46db699f739dead8b0c3a60b6a54365d93 100644 (file)
@@ -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))
index 805e23440e6efa6fddcde82f9368c76a740410fb..24e27a102de35346460a0b1dfb98416e60d09047 100644 (file)
@@ -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)))