diff --git a/packages/desktop/src-tauri/src/cli.rs b/packages/desktop/src-tauri/src/cli.rs index 2fd26dd01c..b019d66b5c 100644 --- a/packages/desktop/src-tauri/src/cli.rs +++ b/packages/desktop/src-tauri/src/cli.rs @@ -1,5 +1,5 @@ -use tauri::{path::BaseDirectory, AppHandle, Manager}; -use tauri_plugin_shell::{process::Command, ShellExt}; +use tauri::{AppHandle, Manager, path::BaseDirectory}; +use tauri_plugin_shell::{ShellExt, process::Command}; const CLI_INSTALL_DIR: &str = ".opencode/bin"; const CLI_BINARY_NAME: &str = "opencode"; @@ -164,11 +164,18 @@ pub fn create_command(app: &tauri::AppHandle, args: &str) -> Command { return { let sidecar = get_sidecar_path(app); let shell = get_user_shell(); + + let cmd = if shell.ends_with("/nu") { + format!("^\"{}\" {}", sidecar.display(), args) + } else { + format!("\"{}\" {}", sidecar.display(), args) + }; + app.shell() .command(&shell) .env("OPENCODE_EXPERIMENTAL_ICON_DISCOVERY", "true") .env("OPENCODE_CLIENT", "desktop") .env("XDG_STATE_HOME", &state_dir) - .args(["-il", "-c", &format!("\"{}\" {}", sidecar.display(), args)]) + .args(["-il", "-c", &cmd]) }; }