From 7d34da3783044d82e2bcedbd703c0c9882e2a0e2 Mon Sep 17 00:00:00 2001 From: Vivek R <123vivekr@gmail.com> Date: Mon, 28 Jul 2025 20:52:57 +0530 Subject: [PATCH] chore(claude): remove unused sidecar execution code - Remove unused imports (tauri_plugin_shell modules) - Delete should_use_sidecar() function - Delete create_sidecar_command() function - Clean up dead code related to sidecar process execution --- src-tauri/src/commands/claude.rs | 39 -------------------------------- 1 file changed, 39 deletions(-) diff --git a/src-tauri/src/commands/claude.rs b/src-tauri/src/commands/claude.rs index 222ee6f..8a6a76c 100644 --- a/src-tauri/src/commands/claude.rs +++ b/src-tauri/src/commands/claude.rs @@ -9,8 +9,6 @@ use std::time::SystemTime; use tauri::{AppHandle, Emitter, Manager}; use tokio::process::{Child, Command}; use tokio::sync::Mutex; -use tauri_plugin_shell::ShellExt; -use tauri_plugin_shell::process::CommandEvent; use regex; /// Global state to track current Claude process @@ -266,43 +264,6 @@ fn create_command_with_env(program: &str) -> Command { tokio_cmd } -/// Determines whether to use sidecar or system binary execution -fn should_use_sidecar(claude_path: &str) -> bool { - claude_path == "claude-code" -} - -/// Creates a sidecar command with the given arguments -fn create_sidecar_command( - app: &AppHandle, - args: Vec, - project_path: &str, -) -> Result { - let mut sidecar_cmd = app - .shell() - .sidecar("claude-code") - .map_err(|e| format!("Failed to create sidecar command: {}", e))?; - - // Add all arguments - sidecar_cmd = sidecar_cmd.args(args); - - // Set working directory - sidecar_cmd = sidecar_cmd.current_dir(project_path); - - // Pass through proxy environment variables if they exist (only uppercase) - for (key, value) in std::env::vars() { - if key == "HTTP_PROXY" - || key == "HTTPS_PROXY" - || key == "NO_PROXY" - || key == "ALL_PROXY" - { - log::debug!("Setting proxy env var for sidecar: {}={}", key, value); - sidecar_cmd = sidecar_cmd.env(&key, &value); - } - } - - Ok(sidecar_cmd) -} - /// Creates a system binary command with the given arguments fn create_system_command( claude_path: &str,