From 17155c4cca44cf4cd5329e5d2e798beec6967cad Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Tue, 21 Oct 2025 20:16:21 +1000 Subject: [PATCH] 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. image ## 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 --- crates/uv-shell/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/uv-shell/src/lib.rs b/crates/uv-shell/src/lib.rs index a18e04b03..d404aa940 100644 --- a/crates/uv-shell/src/lib.rs +++ b/crates/uv-shell/src/lib.rs @@ -329,7 +329,9 @@ fn backtick_escape(s: &str) -> String { let mut escaped = String::with_capacity(s.len()); for c in s.chars() { match c { - '\\' | '"' | '$' => escaped.push('`'), + // Need to also escape unicode double quotes that PowerShell treats + // as the ASCII double quote. + '"' | '`' | '\u{201C}' | '\u{201D}' | '\u{201E}' | '$' => escaped.push('`'), _ => {} } escaped.push(c);