[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tramp (2.5.3.28.2 nil/nil); Backslashes in filenames are not rendere
From: |
Michael Albinus |
Subject: |
Re: tramp (2.5.3.28.2 nil/nil); Backslashes in filenames are not rendered correctly in dired |
Date: |
Sun, 23 Apr 2023 18:52:52 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Adrian Pronk <emacs@dowy.info> writes:
Hi Adrian,
> If a file name on the remote system contains a backslash then this is
> not rendered correctly in a Dired session. For example, if a "b" follows
> the backslash then this is rendered as the backspace character.
>
> The problem appears to lie in:
> ( defconst tramp-perl-directory-files-and-attributes )
> in tramp-sh.el.
>
> The quote character is escaped but the backslash is not.
>
> I tried changing:
> $filename =~ s/\"/\\\\\"/g;
> to:
> $filename =~ s/\\\\/\\\\\\\\/g;
> $filename =~ s/\"/\\\\\"/g;
>
> but this caused Emacs to hang when I scrolled the Dired buffer down to
> the file with the backslash.
>
> Emacs : GNU Emacs 28.2 (build 2, x86_64-w64-mingw32)
> of 2022-09-14
> Package: tramp (2.5.3.28.2 nil/nil)
Well, I could reproduce it with a local Emacs running on MS Windows, as
you do. When I use a local Emacs on my Fedora laptop instead, accessing
the very same remote directory with the file 'a\b', everything is
fine. Dired shows the file, I can read and write it and whatever.
And this is not a surprise. A backslash on MS Windows is a directory
separator. File names containing a backslash aren't supported.
Best regards, Michael.