File tree Expand file tree Collapse file tree
packages/desktop/src-tauri/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ pub fn spawn_command(
308308 } ;
309309
310310 let mut cmd = Command :: new ( shell) ;
311- cmd. args ( [ "-il " , "-c" , & line] ) ;
311+ cmd. args ( [ "-l " , "-c" , & line] ) ;
312312
313313 for ( key, value) in envs {
314314 cmd. env ( key, value) ;
@@ -363,6 +363,7 @@ pub fn spawn_command(
363363 }
364364
365365 tokio:: spawn ( async move {
366+ let mut kill_open = true ;
366367 let status = loop {
367368 match child. try_wait ( ) {
368369 Ok ( Some ( status) ) => break Ok ( status) ,
@@ -371,8 +372,11 @@ pub fn spawn_command(
371372 }
372373
373374 tokio:: select! {
374- _ = kill_rx. recv( ) => {
375- let _ = child. start_kill( ) ;
375+ msg = kill_rx. recv( ) , if kill_open => {
376+ if msg. is_some( ) {
377+ let _ = child. start_kill( ) ;
378+ }
379+ kill_open = false ;
376380 }
377381 _ = tokio:: time:: sleep( Duration :: from_millis( 100 ) ) => { }
378382 }
You can’t perform that action at this time.
0 commit comments