diff options
| author | Chris Yang <[email protected]> | 2026-02-18 00:34:16 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-17 15:34:16 +0000 |
| commit | d055c1cad6b46bee80909d1feffc87be14598e00 (patch) | |
| tree | 4a49bad66efd727750d9dfd58e2470a0e2eaea19 | |
| parent | adfbfe350dac1c78359a38180bba8dafeed9d192 (diff) | |
| download | opencode-d055c1cad6b46bee80909d1feffc87be14598e00.tar.gz opencode-d055c1cad6b46bee80909d1feffc87be14598e00.zip | |
fix(desktop): avoid sidecar health-check timeout on shell startup (#13925)
Co-authored-by: Brendan Allan <[email protected]>
| -rw-r--r-- | packages/desktop/src-tauri/src/cli.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/desktop/src-tauri/src/cli.rs b/packages/desktop/src-tauri/src/cli.rs index 2b60120bb..8d02ba7d4 100644 --- a/packages/desktop/src-tauri/src/cli.rs +++ b/packages/desktop/src-tauri/src/cli.rs @@ -308,7 +308,7 @@ pub fn spawn_command( }; let mut cmd = Command::new(shell); - cmd.args(["-il", "-c", &line]); + cmd.args(["-l", "-c", &line]); for (key, value) in envs { cmd.env(key, value); @@ -363,6 +363,7 @@ pub fn spawn_command( } tokio::spawn(async move { + let mut kill_open = true; let status = loop { match child.try_wait() { Ok(Some(status)) => break Ok(status), @@ -371,8 +372,11 @@ pub fn spawn_command( } tokio::select! { - _ = kill_rx.recv() => { - let _ = child.start_kill(); + msg = kill_rx.recv(), if kill_open => { + if msg.is_some() { + let _ = child.start_kill(); + } + kill_open = false; } _ = tokio::time::sleep(Duration::from_millis(100)) => {} } |
