diff --git a/crates/tui/src/hooks.rs b/crates/tui/src/hooks.rs index 6511dbd8..7843ed54 100644 --- a/crates/tui/src/hooks.rs +++ b/crates/tui/src/hooks.rs @@ -626,8 +626,11 @@ impl HookExecutor { fn build_shell_command(command: &str) -> Command { #[cfg(windows)] { + use std::os::windows::process::CommandExt as _; let mut cmd = Command::new("cmd"); - cmd.arg("/C").arg(command); + // raw_arg: cmd.exe does not parse the CRT-style \" escapes that + // Command::arg would insert, so pass the command line verbatim. + cmd.arg("/C").raw_arg(command); cmd } #[cfg(not(windows))]