From c7cfa5b0fc90048d02be0431826ba9a07d517a68 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 22 Oct 2025 13:46:26 +0200 Subject: [PATCH] Clean up remote client invocation Co-authored-by: Lukas Wirth --- crates/project/src/terminals.rs | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs index 4a0a1790b49449fd82b8aeff58f6c11c8e63261b..49fc5cc5cf4a7e43b7ceb7a805127500935f09fa 100644 --- a/crates/project/src/terminals.rs +++ b/crates/project/src/terminals.rs @@ -168,20 +168,21 @@ impl Project { match remote_client { Some(remote_client) => match activation_script.clone() { activation_script if !activation_script.is_empty() => { - let activation_script = activation_script.join("; "); + let separator = shell_kind.sequential_commands_separator(); + let activation_script = + activation_script.join(&format!("{separator} ")); let to_run = format_to_run(); - let args = vec![ - "-c".to_owned(), - format!("{activation_script}; {to_run}"), - ]; + let shell = remote_client + .read(cx) + .shell() + .unwrap_or_else(get_default_system_shell); + let arg = format!("{activation_script}{separator} {to_run}"); + let args = shell_kind.args_for_shell(false, arg); + + dbg!(&args); + create_remote_shell( - Some(( - &remote_client - .read(cx) - .shell() - .unwrap_or_else(get_default_system_shell), - &args, - )), + Some((&shell, &args)), env, path, remote_client,