Browse Source

desktop: macos killall opencode-cli on launch

Brendan Allan 2 tháng trước cách đây
mục cha
commit
3c5a256f0f

+ 5 - 0
packages/desktop/src-tauri/src/lib.rs

@@ -223,6 +223,11 @@ async fn check_server_health(url: &str, password: Option<&str>) -> bool {
 pub fn run() {
 pub fn run() {
     let updater_enabled = option_env!("TAURI_SIGNING_PRIVATE_KEY").is_some();
     let updater_enabled = option_env!("TAURI_SIGNING_PRIVATE_KEY").is_some();
 
 
+    #[cfg(target_os = "macos")]
+    let _ = std::process::Command::new("killall")
+        .arg("opencode-cli")
+        .output();
+
     let mut builder = tauri::Builder::default()
     let mut builder = tauri::Builder::default()
         .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
         .plugin(tauri_plugin_single_instance::init(|app, _args, _cwd| {
             // Focus existing window when another instance is launched
             // Focus existing window when another instance is launched