From 1a61a799103a35ce6aab6b57589148d600897c4a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 11 Jun 2026 04:46:05 +0000 Subject: [PATCH] =?UTF-8?q?fix(hooks):=20pass=20the=20Windows=20cmd=20/C?= =?UTF-8?q?=20command=20line=20via=20raw=5Farg=20=E2=80=94=20Command::arg'?= =?UTF-8?q?s=20CRT-style=20quoting=20inserted=20literal=20\"=20into=20hook?= =?UTF-8?q?=20commands,=20which=20cmd.exe=20does=20not=20unescape,=20so=20?= =?UTF-8?q?JSON=20decisions=20never=20parsed=20(hook=5Fgate=5F*=20Windows?= =?UTF-8?q?=20failures)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude https://claude.ai/code/session_018zaP8vUfTAsrE38L6h6fw5 --- crates/tui/src/hooks.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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))]