Make ShellBuilder::new not branch on a remote shell (#39493)

Release Notes:

- Fixed claude code agent login on remotes

Co-authored-by: Max Brunsfeld <max@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
Lukas Wirth
2025-10-03 23:23:09 +02:00
committed by GitHub
co-authored by Max Brunsfeld Cole Miller
parent 4443f61c16
commit 2859cbdba9
10 changed files with 70 additions and 62 deletions
+12 -9
View File
@@ -9,6 +9,7 @@ use futures::io::BufReader;
use project::Project;
use project::agent_server_store::AgentServerCommand;
use serde::Deserialize;
use task::Shell;
use util::ResultExt as _;
use std::path::PathBuf;
@@ -820,15 +821,17 @@ impl acp::Client for ClientDelegate {
}
// Use remote shell or default system shell, as appropriate
let remote_shell = project.update(&mut self.cx.clone(), |project, cx| {
project
.remote_client()
.and_then(|r| r.read(cx).default_system_shell())
})?;
let (task_command, task_args) =
task::ShellBuilder::new(remote_shell.as_deref(), &task::Shell::System)
.redirect_stdin_to_dev_null()
.build(Some(args.command.clone()), &args.args);
let shell = project
.update(&mut self.cx.clone(), |project, cx| {
project
.remote_client()
.and_then(|r| r.read(cx).default_system_shell())
.map(Shell::Program)
})?
.unwrap_or(task::Shell::System);
let (task_command, task_args) = task::ShellBuilder::new(&shell)
.redirect_stdin_to_dev_null()
.build(Some(args.command.clone()), &args.args);
let terminal_entity = project
.update(&mut self.cx.clone(), |project, cx| {