`("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'"
`("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
`("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'"
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "pscp")
- (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp")
- ;; Since PuTTY 0.82.
- ("-legacy-stdio-prompts")
+ (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-scp") ("%c")
("-p" "%k") ("-q") ("-r")))
(tramp-copy-keep-date t)
(tramp-copy-recursive t)))
`("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'"
(tramp-remote-shell-login ("-l"))
(tramp-remote-shell-args ("-c"))
(tramp-copy-program "pscp")
- (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp")
- ;; Since PuTTY 0.82.
- ("-legacy-stdio-prompts")
+ (tramp-copy-args (("-l" "%u") ("-P" "%p") ("-sftp") ("%c")
("-p" "%k")))
(tramp-copy-keep-date t)))
;; Compose copy command.
(setq options
(format-spec
- (tramp-ssh-controlmaster-options v)
+ (tramp-ssh-or-plink-options v)
(format-spec-make
?t (tramp-get-connection-property
(tramp-get-connection-process v) "temp-file" "")))
(zerop
(tramp-call-process vec "ssh" nil nil nil "-G" "-o" option "0.0.0.1"))))
-(defun tramp-ssh-controlmaster-options (vec)
- "Return the Control* arguments of the local ssh."
+(defun tramp-plink-option-exists-p (vec option)
+ "Check, whether local plink OPTION is applicable."
+ ;; We don't want to cache it persistently.
+ (with-tramp-connection-property nil option
+ ;; "plink" with valid options returns "plink: no valid host name
+ ;; provided". We xcheck for this error message."
+ (with-temp-buffer
+ (tramp-call-process vec "plink" nil t nil option)
+ (not
+ (string-match-p
+ (rx (| (: "plink: unknown option \"" (literal option) "\"" )
+ (: "plink: option \"" (literal option)
+ "\" not available in this tool" )))
+ (buffer-string))))))
+
+(defun tramp-ssh-or-plink-options (vec)
+ "Return additional arguments of the local ssh or plink."
(cond
;; No options to be computed.
- ((or (null tramp-use-connection-share)
- (null (assoc "%c" (tramp-get-method-parameter vec 'tramp-login-args))))
- "")
+ ((null (assoc "%c" (tramp-get-method-parameter vec 'tramp-login-args))) "")
- ;; Use plink option.
+ ;; Use plink options.
((string-match-p
(rx "plink" (? ".exe") eol)
(tramp-get-method-parameter vec 'tramp-login-program))
- (if (eq tramp-use-connection-share 'suppress)
- "-noshare" "-share"))
+ (concat
+ (if (eq tramp-use-connection-share 'suppress)
+ "-noshare" "-share")
+ ;; Since PuTTY 0.82.
+ (when (tramp-plink-option-exists-p vec "-legacy-stdio-prompts")
+ " -legacy-stdio-prompts")))
;; There is already a value to be used.
((and (eq tramp-use-connection-share t)
(stringp tramp-ssh-controlmaster-options))
tramp-ssh-controlmaster-options)
- ;; We can't auto-compute the options.
- ((ignore-errors
- (not (tramp-ssh-option-exists-p vec "ControlMaster=auto")))
- "")
-
- ;; Determine the options.
- (t (ignore-errors
- ;; ControlMaster and ControlPath options are introduced in OpenSSH 3.9.
- (concat
- "-o ControlMaster="
- (if (eq tramp-use-connection-share 'suppress)
+ ;; Use ssh options.
+ (tramp-use-connection-share
+ ;; We can't auto-compute the options.
+ (if (ignore-errors
+ (not (tramp-ssh-option-exists-p vec "ControlMaster=auto")))
+ ""
+
+ ;; Determine the options.
+ (ignore-errors
+ ;; ControlMaster and ControlPath options are introduced in OpenSSH 3.9.
+ (concat
+ "-o ControlMaster="
+ (if (eq tramp-use-connection-share 'suppress)
"no" "auto")
- " -o ControlPath="
- (if (eq tramp-use-connection-share 'suppress)
+ " -o ControlPath="
+ (if (eq tramp-use-connection-share 'suppress)
"none"
;; Hashed tokens are introduced in OpenSSH 6.7. On macOS
;; we cannot use an absolute file name, it is too long.
(or small-temporary-file-directory
tramp-compat-temporary-file-directory))))
- ;; ControlPersist option is introduced in OpenSSH 5.6.
+ ;; ControlPersist option is introduced in OpenSSH 5.6.
(when (and (not (eq tramp-use-connection-share 'suppress))
(tramp-ssh-option-exists-p vec "ControlPersist=no"))
- " -o ControlPersist=no"))))))
+ " -o ControlPersist=no")))))))
(defun tramp-scp-strict-file-name-checking (vec)
"Return the strict file name checking argument of the local scp."
(let* ((current-host tramp-system-name)
(target-alist (tramp-compute-multi-hops vec))
(previous-hop tramp-null-hop)
- ;; We will apply `tramp-ssh-controlmaster-options'
+ ;; We will apply `tramp-ssh-or-plink-options'
;; only for the first hop.
- (options (tramp-ssh-controlmaster-options vec))
+ (options (tramp-ssh-or-plink-options vec))
(process-connection-type tramp-process-connection-type)
(process-adaptive-read-buffering nil)
;; There are unfortunate settings for "cmdproxy"
;; We flush connection properties
;; " process-name" and " process-buffer",
;; because the operations shall be applied
- ;; in the main connection process. In order
- ;; to avoid superfluous debug buffers during
- ;; host name completion, we adapt
- ;; `tramp-verbose'.
+ ;; in the main connection process.
;; If `non-essential' is non-nil, Tramp shall
;; not open a new connection.
;; If Tramp detects that it shouldn't continue
;; In both cases, we try the default handler then.
(with-tramp-saved-connection-properties
v '(" process-name" " process-buffer")
- (let ((tramp-verbose
- (if minibuffer-completing-file-name
- 0 tramp-verbose)))
- (tramp-flush-connection-property v " process-name")
- (tramp-flush-connection-property v " process-buffer"))
+ (tramp-flush-connection-property v " process-name")
+ (tramp-flush-connection-property v " process-buffer")
(setq result
(catch 'non-essential
(catch 'suppress
tramp-copy-size-limit nil
tramp-error-show-message-timeout nil
tramp-persistency-file-name nil
- tramp-verbose 0)
+ tramp-verbose 0
+ vc-handled-backends nil)
(defconst tramp-test-name-prefix "tramp-test"
"Prefix to use for temporary test files.")
(file-writable-p ert-remote-temporary-file-directory))))))
(when (cdr tramp--test-enabled-checked)
- ;; Remove old test files.
- (dolist (dir `(,temporary-file-directory
- ,tramp-compat-temporary-file-directory
- ,ert-remote-temporary-file-directory))
- (dolist (file (directory-files
- dir 'full
- (rx-to-string
- `(: bos (? ".#")
- (| ,tramp-test-name-prefix
- ,(if (getenv "TRAMP_TEST_CLEANUP_TEMP_FILES")
- tramp-temp-name-prefix 'unmatchable))))))
-
- ;; Exclude sockets and FUSE mount points.
- (ignore-errors
+ (ignore-errors
+ ;; Remove old test files.
+ (dolist (dir `(,temporary-file-directory
+ ,tramp-compat-temporary-file-directory
+ ,ert-remote-temporary-file-directory))
+ (dolist (file (directory-files
+ dir 'full
+ (rx-to-string
+ `(: bos (? ".#")
+ (| ,tramp-test-name-prefix
+ ,(if (getenv "TRAMP_TEST_CLEANUP_TEMP_FILES")
+ tramp-temp-name-prefix 'unmatchable))))))
+
+ ;; Exclude sockets and FUSE mount points.
(unless
(or (string-prefix-p
"srw" (file-attribute-modes (file-attributes file)))