aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2025-02-14 15:21:30 +0100
committerMichael Albinus2025-02-14 15:21:30 +0100
commit9ded6fd73e929977a38d4c644aa4e9fe66e76e90 (patch)
tree66a3f83a02c16574c74205e50d1ed58b8861c9a1
parent608113628c2750b09b925b17c96a29b2dc9abc37 (diff)
downloademacs-9ded6fd73e929977a38d4c644aa4e9fe66e76e90.tar.gz
emacs-9ded6fd73e929977a38d4c644aa4e9fe66e76e90.zip
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) <plink, plinkx, pscp, psftp>: Adapt `tramp-login-args' and `tramp-copy-args' arguments. (Bug#75746)
-rw-r--r--doc/misc/tramp.texi10
-rw-r--r--lisp/net/tramp-cache.el4
-rw-r--r--lisp/net/tramp-sh.el12
3 files changed, 22 insertions, 4 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 86ffba29744..ac0bb63335c 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
955@cindex @option{plink} method 955@cindex @option{plink} method
956@item @option{plink} 956@item @option{plink}
957 957
958@option{plink} method is for MS Windows users with the PuTTY 958@option{plink} method is for MS Windows users with the
959implementation of SSH@. It uses @samp{plink -ssh} to log in to the 959PuTTY@footnote{It requires at least PuTTY 0.82.} implementation of
960remote host. It supports changing the remote login shell @command{/bin/sh}. 960SSH@. It uses @samp{plink -ssh} to log in to the remote host. It
961supports changing the remote login shell @command{/bin/sh}.
961 962
962Check the @samp{Share SSH connections if possible} control for that 963Check the @samp{Share SSH connections if possible} control for that
963session. 964session.
@@ -1190,7 +1191,8 @@ This method supports the @samp{-p} argument.
1190These methods are similar to @option{scp} or @option{sftp}, but they 1191These methods are similar to @option{scp} or @option{sftp}, but they
1191use the @command{plink} command to connect to the remote host, and 1192use the @command{plink} command to connect to the remote host, and
1192they use @command{pscp} or @command{psftp} for transferring the files. 1193they use @command{pscp} or @command{psftp} for transferring the files.
1193These programs are part of PuTTY, an SSH implementation for MS Windows. 1194These programs are part of PuTTY@footnote{It requires at least PuTTY
11950.82.}, an SSH implementation for MS Windows.
1194 1196
1195They support changing the remote login shell @command{/bin/sh}. 1197They support changing the remote login shell @command{/bin/sh}.
1196 1198
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index a5245deaf2b..e7ad565dc30 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."
482 (hash (tramp-get-hash-table key)) 482 (hash (tramp-get-hash-table key))
483 (cached (and (hash-table-p hash) 483 (cached (and (hash-table-p hash)
484 (gethash ,property hash tramp-cache-undefined)))) 484 (gethash ,property hash tramp-cache-undefined))))
485 (tramp-message key 7 "Saved %s %s" property cached)
485 (unwind-protect (progn ,@body) 486 (unwind-protect (progn ,@body)
486 ;; Reset PROPERTY. Recompute hash, it could have been flushed. 487 ;; Reset PROPERTY. Recompute hash, it could have been flushed.
488 (tramp-message key 7 "Restored %s %s" property cached)
487 (setq hash (tramp-get-hash-table key)) 489 (setq hash (tramp-get-hash-table key))
488 (if (not (eq cached tramp-cache-undefined)) 490 (if (not (eq cached tramp-cache-undefined))
489 (puthash ,property cached hash) 491 (puthash ,property cached hash)
@@ -501,8 +503,10 @@ PROPERTIES is a list of file properties (strings)."
501 (lambda (property) 503 (lambda (property)
502 (cons property (gethash property hash tramp-cache-undefined))) 504 (cons property (gethash property hash tramp-cache-undefined)))
503 ,properties))) 505 ,properties)))
506 (tramp-message key 7 "Saved %s" values)
504 (unwind-protect (progn ,@body) 507 (unwind-protect (progn ,@body)
505 ;; Reset PROPERTIES. Recompute hash, it could have been flushed. 508 ;; Reset PROPERTIES. Recompute hash, it could have been flushed.
509 (tramp-message key 7 "Restored %s" values)
506 (setq hash (tramp-get-hash-table key)) 510 (setq hash (tramp-get-hash-table key))
507 (dolist (value values) 511 (dolist (value values)
508 (if (not (eq (cdr value) tramp-cache-undefined)) 512 (if (not (eq (cdr value) tramp-cache-undefined))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index a21af990e0e..f85a371cded 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -322,6 +322,8 @@ The string is used in `tramp-methods'.")
322 `("plink" 322 `("plink"
323 (tramp-login-program "plink") 323 (tramp-login-program "plink")
324 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c") 324 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c")
325 ;; Since PuTTY 0.82.
326 ("-legacy-stdio-prompts")
325 ("-t") ("%h") ("\"") 327 ("-t") ("%h") ("\"")
326 (,(format 328 (,(format
327 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" 329 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
@@ -335,6 +337,8 @@ The string is used in `tramp-methods'.")
335 `("plinkx" 337 `("plinkx"
336 (tramp-login-program "plink") 338 (tramp-login-program "plink")
337 (tramp-login-args (("-load") ("%h") ("%c") ("-t") ("\"") 339 (tramp-login-args (("-load") ("%h") ("%c") ("-t") ("\"")
340 ;; Since PuTTY 0.82.
341 ("-legacy-stdio-prompts")
338 (,(format 342 (,(format
339 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" 343 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
340 tramp-terminal-type 344 tramp-terminal-type
@@ -347,6 +351,8 @@ The string is used in `tramp-methods'.")
347 `("pscp" 351 `("pscp"
348 (tramp-login-program "plink") 352 (tramp-login-program "plink")
349 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c") 353 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c")
354 ;; Since PuTTY 0.82.
355 ("-legacy-stdio-prompts")
350 ("-t") ("%h") ("\"") 356 ("-t") ("%h") ("\"")
351 (,(format 357 (,(format
352 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" 358 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
@@ -358,6 +364,8 @@ The string is used in `tramp-methods'.")
358 (tramp-remote-shell-args ("-c")) 364 (tramp-remote-shell-args ("-c"))
359 (tramp-copy-program "pscp") 365 (tramp-copy-program "pscp")
360 (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp") 366 (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp")
367 ;; Since PuTTY 0.82.
368 ("-legacy-stdio-prompts")
361 ("-p" "%k") ("-q") ("-r"))) 369 ("-p" "%k") ("-q") ("-r")))
362 (tramp-copy-keep-date t) 370 (tramp-copy-keep-date t)
363 (tramp-copy-recursive t))) 371 (tramp-copy-recursive t)))
@@ -365,6 +373,8 @@ The string is used in `tramp-methods'.")
365 `("psftp" 373 `("psftp"
366 (tramp-login-program "plink") 374 (tramp-login-program "plink")
367 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c") 375 (tramp-login-args (("-l" "%u") ("-P" "%p") ("-ssh") ("%c")
376 ;; Since PuTTY 0.82.
377 ("-legacy-stdio-prompts")
368 ("-t") ("%h") ("\"") 378 ("-t") ("%h") ("\"")
369 (,(format 379 (,(format
370 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'" 380 "env 'TERM=%s' 'PROMPT_COMMAND=' 'PS1=%s'"
@@ -376,6 +386,8 @@ The string is used in `tramp-methods'.")
376 (tramp-remote-shell-args ("-c")) 386 (tramp-remote-shell-args ("-c"))
377 (tramp-copy-program "pscp") 387 (tramp-copy-program "pscp")
378 (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp") 388 (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp")
389 ;; Since PuTTY 0.82.
390 ("-legacy-stdio-prompts")
379 ("-p" "%k"))) 391 ("-p" "%k")))
380 (tramp-copy-keep-date t))) 392 (tramp-copy-keep-date t)))
381 393