Commit f9e962c
Escape single quotes while translating dropped Win32 paths (#18007)
When file/folder is dropped to the terminal, its path is translated and
quoted with a pair of single quotes if necessary.
However, the terminal control does not escape single quotes (allowed in
the Win32 subsystem) that need escapes when translated.
On the translation styles other than `"none"` (note: all other
translation styles are currently intended for the POSIX shell), it
causes incorrect path to be pasted when the path contains one or more
single quotes (see #18006 for an example).
With this commit, the terminal control escapes a single quote with a
valid escape sequence `'\''` (finish quote, print a single quote then
begin quote again) when the path translation is required.
* Changed escape sequence from `'"'"'` to much shorter `'\''`.
* Reflected comments by the reviewer.
* Overhaul after addition of multiple path translation styles (not just
WSL but Cygwin and MSYS).
* More clarification both in the code and in the commit message.
* Minor clarification both in the code and in the commit message.
* #18006
* #16214
* #18195
This is a follow-up of #16214 and #18195, fixing #18006.
Closes #18006
Supersedes 7878728
(cherry picked from commit ae90d52)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgVEvdU
Service-Version: 1.221 parent 3af8a05 commit f9e962c
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
78 | 90 | | |
79 | 91 | | |
80 | 92 | | |
| |||
0 commit comments