From: Michael Albinus Date: Sun, 9 May 2021 13:37:37 +0000 (+0200) Subject: Cleanups for Tramp out-of-band methods on MS Windows X-Git-Tag: emacs-28.0.90~2541 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=515cac0dc046940bbbcb7deb5c7e8dcf8c785359;p=emacs.git Cleanups for Tramp out-of-band methods on MS Windows * doc/misc/tramp.texi (Frequently Asked Questions): tramp-use-ssh-controlmaster-options is nil on MS Windows. * lisp/net/tramp.el (tramp-unquote-shell-quote-argument): Revert previous change, it worked (not as expected but) properly. * test/lisp/net/tramp-tests.el (tramp-test17-dired-with-wildcards): Don't skip on MS Windows. (tramp--test-windows-nt-and-scp-p): Remove. (tramp--test-special-characters): Skip for out-of-band methods on MS Windows, sometimes. --- diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 47beb90e6c6..e5a0bb9a8b6 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -2166,7 +2166,7 @@ commands for those hosts, the property @t{"posix"} should be set to The default value of this property is @code{t} (not specified in @code{tramp-methods}). If the remote host runs native MS Windows, -this propery has no effect. +this property has no effect. @item @t{"mount-point"} @@ -4504,9 +4504,9 @@ Note how @samp{%r}, @samp{%h} and @samp{%p} must be encoded as @samp{%%r}, @samp{%%h} and @samp{%%p}. @vindex tramp-use-ssh-controlmaster-options -If the @file{~/.ssh/config} is configured appropriately for the above -behavior, then any changes to @command{ssh} can be suppressed with -this @code{nil} setting: +If the @file{~/.ssh/config} file is configured appropriately for the +above behavior, then any changes to @command{ssh} can be suppressed +with this @code{nil} setting: @lisp (customize-set-variable 'tramp-use-ssh-controlmaster-options nil) @@ -4518,6 +4518,10 @@ This should also be set to @code{nil} if you use the @option{ProxyCommand} or @option{ProxyJump} options in your @command{ssh} configuration. +On MS Windows, @code{tramp-use-ssh-controlmaster-options} is set to +@code{nil} by default, because the MS Windows and MSYS2 +implementations of @command{OpenSSH} do not support this option properly. + @item On multi-hop connections, @value{tramp} does not use @command{ssh} diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 5d62a1fb3d1..9fec1514221 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -5476,12 +5476,8 @@ T1 and T2 are time values (as returned by `current-time' for example)." "Remove quotation prefix \"/:\" from string S, and quote it then for shell. Suppress `shell-file-name'. This is needed on w32 systems, which would use a wrong quoting for local file names. See `w32-shell-name'." - (if (eq system-type 'windows-nt) - (let ((result (tramp-compat-file-name-unquote s))) - (setq result (tramp-compat-string-replace "\"" "\"\"" result)) - (concat "\"" result "\"")) - (let (shell-file-name) - (shell-quote-argument (tramp-compat-file-name-unquote s))))) + (let (shell-file-name) + (shell-quote-argument (tramp-compat-file-name-unquote s)))) ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' ;; does not deal well with newline characters. Newline is replaced by diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 03915d7a3fc..52480bac7ec 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3094,7 +3094,6 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." (skip-unless (tramp--test-enabled)) (skip-unless (tramp--test-sh-p)) (skip-unless (not (tramp--test-rsync-p))) - (skip-unless (not (tramp--test-windows-nt-and-scp-p))) ;; Wildcards are not supported in tramp-crypt.el. (skip-unless (not (tramp--test-crypt-p))) ;; Since Emacs 26.1. @@ -5842,13 +5841,6 @@ This does not support utf8 based file transfer." (and (eq system-type 'windows-nt) (tramp-method-out-of-band-p tramp-test-vec 1))) -(defun tramp--test-windows-nt-and-scp-p () - "Check, whether the locale host runs MS Windows, and scpx? is used. -This does not support utf8 based file transfer." - (and (eq system-type 'windows-nt) - (string-match-p - "^scpx?" (file-remote-p tramp-test-temporary-file-directory 'method)))) - (defun tramp--test-windows-nt-or-smb-p () "Check, whether the locale or remote host runs MS Windows. This requires restrictions of file name syntax." @@ -6072,10 +6064,9 @@ This requires restrictions of file name syntax." "\tfoo bar baz\t") (t " foo\tbar baz\t")) "@foo@bar@baz@" - (unless (tramp--test-windows-nt-and-scp-p) - "$foo$bar$$baz$") + (unless (tramp--test-windows-nt-and-out-of-band-p) "$foo$bar$$baz$") "-foo-bar-baz-" - "%foo%bar%baz%" + (unless (tramp--test-windows-nt-and-out-of-band-p) "%foo%bar%baz%") "&foo&bar&baz&" (unless (or (tramp--test-ftp-p) (tramp--test-gvfs-p) @@ -6089,7 +6080,7 @@ This requires restrictions of file name syntax." "'foo'bar'baz'" "'foo\"bar'baz\"") "#foo~bar#baz~" - (unless (tramp--test-windows-nt-and-scp-p) + (unless (tramp--test-windows-nt-and-out-of-band-p) (if (or (tramp--test-gvfs-p) (tramp--test-windows-nt-or-smb-p)) "!foo!bar!baz!" "!foo|bar!baz|"))