File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5894,14 +5894,25 @@ fn cancel_claude_code_install() -> Result<(), String> {
58945894 return Err ( "No install process running" . to_string ( ) ) ;
58955895 }
58965896
5897- // Use pkill to kill child processes first (curl, bash, etc.)
5898- let _ = std:: process:: Command :: new ( "pkill" )
5899- . args ( [ "-9" , "-P" , & pid. to_string ( ) ] )
5900- . output ( ) ;
5897+ #[ cfg( unix) ]
5898+ {
5899+ // Use pkill to kill child processes first (curl, bash, etc.)
5900+ let _ = std:: process:: Command :: new ( "pkill" )
5901+ . args ( [ "-9" , "-P" , & pid. to_string ( ) ] )
5902+ . output ( ) ;
5903+
5904+ // Kill the main process with SIGKILL
5905+ unsafe {
5906+ libc:: kill ( pid as i32 , libc:: SIGKILL ) ;
5907+ }
5908+ }
59015909
5902- // Kill the main process with SIGKILL
5903- unsafe {
5904- libc:: kill ( pid as i32 , libc:: SIGKILL ) ;
5910+ #[ cfg( windows) ]
5911+ {
5912+ // On Windows, use taskkill to terminate the process tree
5913+ let _ = std:: process:: Command :: new ( "taskkill" )
5914+ . args ( [ "/F" , "/T" , "/PID" , & pid. to_string ( ) ] )
5915+ . output ( ) ;
59055916 }
59065917
59075918 CC_INSTALL_PID . store ( 0 , std:: sync:: atomic:: Ordering :: SeqCst ) ;
You can’t perform that action at this time.
0 commit comments