From b19fceeba949302d152bc6b0a7c73f6b1d386ff7 Mon Sep 17 00:00:00 2001 From: Joe Xue Date: Wed, 19 Feb 2025 18:29:03 -0500 Subject: [PATCH] Tmux control: put bootstrap pane and tmux panes in same window refs: #336 --- mux/src/tmux.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/mux/src/tmux.rs b/mux/src/tmux.rs index ea4d20829..ba889ef50 100644 --- a/mux/src/tmux.rs +++ b/mux/src/tmux.rs @@ -1,3 +1,4 @@ +use crate::activity::Activity; use crate::domain::{alloc_domain_id, Domain, DomainId, DomainState, SplitSource}; use crate::pane::{Pane, PaneId}; use crate::tab::{SplitRequest, Tab, TabId}; @@ -264,10 +265,20 @@ impl TmuxDomainState { pub fn create_gui_window(&self) { if self.gui_window.lock().is_none() { let mux = Mux::get(); - let window_builder = mux.new_empty_window( - None, /* TODO: pass session here */ - None, /* position */ - ); + let window_builder = + if let Some((_domain, window_id, _tab)) = mux.resolve_pane_id(self.pane_id) { + MuxWindowBuilder { + window_id, + activity: Some(Activity::new()), + notified: false, + } + } else { + mux.new_empty_window( + None, /* TODO: pass session here */ + None, /* position */ + ) + }; + log::info!("Tmux create window id {}", window_builder.window_id); { let mut window_id = self.gui_window.lock();