From 256fe6e45c44b6390ea73946dbf97992f502c6ca Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 22 Oct 2025 00:08:56 +0300 Subject: [PATCH] Fix task terminal split (#40824) Before: https://github.com/user-attachments/assets/efe2aeb6-94bb-46b6-944f-5a6345c072b4 After: https://github.com/user-attachments/assets/61a7f699-6b4d-465f-add1-07774068420c Release Notes: - Fixed task terminal split not working correctly --- crates/project/src/terminals.rs | 6 ++++++ crates/terminal/src/terminal.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs index 360391210c75d88e67b1e08be3e0c865b33397c8..4a0a1790b49449fd82b8aeff58f6c11c8e63261b 100644 --- a/crates/project/src/terminals.rs +++ b/crates/project/src/terminals.rs @@ -417,6 +417,12 @@ impl Project { cx: &mut Context<'_, Project>, cwd: Option, ) -> Task>> { + // We cannot clone the task's terminal, as it will effectively re-spawn the task, which might not be desirable. + // For now, create a new shell instead. + if terminal.read(cx).task().is_some() { + return self.create_terminal_shell(cwd, cx); + } + let local_path = if self.is_via_remote_server() { None } else { diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index e35a3ae4e14dec8c510e4858adaeabb789436de0..fa42a94e932a81d171ffc871393a30abf965678f 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -454,7 +454,7 @@ impl TerminalBuilder { args: Option>, title_override: Option, ) -> Self { - log::info!("Using {program} as shell"); + log::debug!("Using {program} as shell"); Self { program, args,