Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix terminal pane showing welcome screen during loading (#48930)
Bennet Bo Fenner3938403a0141
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rsindex f0251317587..be5c1efbdf7 100644--- a/crates/workspace/src/pane.rs+++ b/crates/workspace/src/pane.rs@@ -391,6 +391,7 @@ pub struct Pane {Option<Arc<dyn Fn(&mut Self, &dyn Any, &mut Window, &mut Context<Self>) -> bool>>,can_toggle_zoom: bool,should_display_tab_bar: Rc<dyn Fn(&Window, &mut Context<Pane>) -> bool>,+ should_display_welcome_page: bool,render_tab_bar_buttons: Rc<dyn Fn(&mut Pane,@@ -574,6 +575,7 @@ impl Pane {can_split_predicate: None,can_toggle_zoom: true,should_display_tab_bar: Rc::new(|_, cx| TabBarSettings::get_global(cx).show),+ should_display_welcome_page: false,render_tab_bar_buttons: Rc::new(default_render_tab_bar_buttons),render_tab_bar: Rc::new(Self::render_tab_bar),show_tab_bar_buttons: TabBarSettings::get_global(cx).show_tab_bar_buttons,@@ -681,7 +683,9 @@ impl Pane {self.last_focus_handle_by_item.insert(active_item.item_id(), focused.downgrade());}- } else if let Some(welcome_page) = self.welcome_page.as_ref() {+ } else if self.should_display_welcome_page+ && let Some(welcome_page) = self.welcome_page.as_ref()+ {if self.focus_handle.is_focused(window) {welcome_page.read(cx).focus_handle(cx).focus(window, cx);}@@ -793,6 +797,10 @@ impl Pane {self.should_display_tab_bar = Rc::new(should_display_tab_bar);}+ pub fn set_should_display_welcome_page(&mut self, should_display_welcome_page: bool) {+ self.should_display_welcome_page = should_display_welcome_page;+ }+pub fn set_can_split(&mut self,can_split_predicate: Option<@@ -4391,7 +4399,7 @@ impl Render for Pane {}},));- if has_worktrees {+ if has_worktrees || !self.should_display_welcome_page {placeholder} else {if self.welcome_page.is_none() {diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rsindex 019329a8a8b..9f242d670d1 100644--- a/crates/workspace/src/workspace.rs+++ b/crates/workspace/src/workspace.rs@@ -1446,6 +1446,7 @@ impl Workspace {cx,);center_pane.set_can_split(Some(Arc::new(|_, _, _, _| true)));+ center_pane.set_should_display_welcome_page(true);center_pane});cx.subscribe_in(¢er_pane, window, Self::handle_pane_event)