Skip to content

Commit 17155c4

Browse files
jborean93Gankra
andauthored
Fix backtick escaping for PowerShell (#16307)
## Summary Fixes the logic for escaping a double quoted string in PowerShell by not escaping a backslash but escaping the Unicode double quote variants that PowerShell treats the same as the ASCII double quotes. <img width="685" height="99" alt="image" src="https://github.com/user-attachments/assets/ac1368c2-d915-4e49-b67f-ac71ee0f7d46" /> ## Test Plan There does not seem to be any tests for this. I'm fairly new to rust but happy to add some if someone can point me in the right direction. --------- Co-authored-by: Aria Desires <aria.desires@gmail.com>
1 parent 51e8da2 commit 17155c4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/uv-shell/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ fn backtick_escape(s: &str) -> String {
329329
let mut escaped = String::with_capacity(s.len());
330330
for c in s.chars() {
331331
match c {
332-
'\\' | '"' | '$' => escaped.push('`'),
332+
// Need to also escape unicode double quotes that PowerShell treats
333+
// as the ASCII double quote.
334+
'"' | '`' | '\u{201C}' | '\u{201D}' | '\u{201E}' | '$' => escaped.push('`'),
333335
_ => {}
334336
}
335337
escaped.push(c);

0 commit comments

Comments
 (0)