tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell-quoting issue for sshx/scpx on MS Windows


From: Jim Porter
Subject: Re: Shell-quoting issue for sshx/scpx on MS Windows
Date: Tue, 13 Apr 2021 12:56:45 -0700

On Tue, Apr 13, 2021 at 10:52 AM Michael Albinus <michael.albinus@gmx.de> wrote:
> Anyway, the Tramp test suite does not run through. Copying files with a
> space in their file name, via scp, does not work. I guess it needs kind
> of quoting, but I don't know which. See
>
> --8<---------------cut here---------------start------------->8---
> scp albinus@gandalf:/home/albinus/.emacs 
> "c:/Users/albinus/AppData/Local/Temp/foo bar baz"
> --8<---------------cut here---------------end--------------->8---
>
> Quoting a local file name works.
>
> --8<---------------cut here---------------start------------->8---
> scp "c:/Users/albinus/AppData/Local/Temp/foo bar baz" 
> albinus@gandalf:/home/albinus/tmp
> --8<---------------cut here---------------end--------------->8---
>
> This works also. "/home/albinus/tmp/foo bar baz" has appeared on the
> remote machine.
>
> --8<---------------cut here---------------start------------->8---
> scp "c:/Users/albinus/AppData/Local/Temp/foo bar baz" 
> "albinus@gandalf:/home/albinus/tmp/blub bla"
> scp: ambiguous target
> --8<---------------cut here---------------end--------------->8---
>
> Doesn't work. Do you have an idea, which kind of quoting for the remote
> target I need?

I haven't spent too much time looking at the scp method under MS
Windows, but I know there have been some changes to Win32-OpenSSH that
might affect things here. In v7.9.0.0p1-Beta[1], the quoting logic was
improved (see the "Rich command-line support..." bullet point in the
release notes for details). This might fix the issue you're seeing.
This will probably mean manually installing[2] Win32-OpenSSH, since
Microsoft is very conservative about publishing OpenSSH updates via
their Windows Update service. I haven't tried this yet though, so I
can't be sure if it fixes the issue you're seeing.

v7.9 also includes support for ConPTY (the "Windows Pseudo
Console")[3]. This seems to be relevant mostly for the OpenSSH server,
and might make things work better when connecting to an MS Windows
system; that probably first requires Tramp to handle the ANSI escapes
I mentioned previously, though.

- Jim

[1] https://github.com/PowerShell/Win32-OpenSSH/releases/tag/v7.9.0.0p1-Beta
[2] https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH
[3] 
https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]