Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

gui: let a sole surviving renderer keep its local panes visible

RoversXf8ea14db2334
diff --git a/wezterm-gui/src/termwindow/resize.rs b/wezterm-gui/src/termwindow/resize.rs
index fab5cb08..26c0b114 100644
--- a/wezterm-gui/src/termwindow/resize.rs
+++ b/wezterm-gui/src/termwindow/resize.rs
@@ -246,12 +246,14 @@ impl super::TermWindow {
let gate = if let Some(client) = pane.downcast_ref::<ClientPane>() {
client.remote_frontend_gate()
} else {
- let state = Mux::get().frontend_access_state();
+ let mux = Mux::get();
+ let state = mux.frontend_access_state();
+ // The lease predicate, not a bare owner comparison: it carries the
+ // sole-live-renderer recovery, so after the last TUI detaches the
+ // GUI's own panes come back on their own instead of sitting behind
+ // a takeover surface with nobody left to take the terminal from.
if state.mode == mux::FrontendAccessMode::TmuxLatest
- || Mux::get()
- .active_identity()
- .as_deref()
- .is_some_and(|identity| state.owner.as_ref() == Some(identity))
+ || mux.current_identity_owns_frontend_lease(tab.tab_id())
{
RemoteFrontendGate::Visible
} else {