Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix task terminal split (#40824)

Kirill Bulatov256fe6e45c44
diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs
index 360391210c7..4a0a1790b49 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<PathBuf>,
) -> Task<Result<Entity<Terminal>>> {
+ // 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 e35a3ae4e14..fa42a94e932 100644
--- a/crates/terminal/src/terminal.rs
+++ b/crates/terminal/src/terminal.rs
@@ -454,7 +454,7 @@ impl TerminalBuilder {
args: Option<Vec<String>>,
title_override: Option<SharedString>,
) -> Self {
- log::info!("Using {program} as shell");
+ log::debug!("Using {program} as shell");
Self {
program,
args,