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.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
fix(gui): cut from the travelling terminal to its card, not dissolve
RoversXed25543926e1
diff --git a/wezterm-gui/src/termwindow/live_overview.rs b/wezterm-gui/src/termwindow/live_overview.rsindex 82655993..388d0d53 100644--- a/wezterm-gui/src/termwindow/live_overview.rs+++ b/wezterm-gui/src/termwindow/live_overview.rs@@ -1230,7 +1230,29 @@ impl LiveOverviewView {preview_fill,ctx.px(PREVIEW_RADIUS),)?;- if !in_flight {+ if in_flight {+ // Built, not shown. The thumbnail's quads+ // take several frames to record, and the+ // dissolve that lands the travelling+ // terminal on this card began on the frame+ // the card was handed its picture back --+ // which left the panel showing through for+ // as long as the recording took. Asking for+ // the picture at zero opacity during the+ // flight has it recorded by the time the+ // terminal arrives, and the landing waits+ // for it (see `paint_content_view_flight`).+ if let Some(snapshot) = snapshot.as_ref() {+ self.previews.push(TerminalPreviewRequest {+ tab_id,+ snapshot: Arc::clone(snapshot),+ area: preview,+ clip,+ hold_scale: self.live_resizing,+ opacity: 0.0,+ });+ }+ } else {// A card that changed tab fades the old// picture out under the new one. The old// tab's snapshot is kept warm for the lengthdiff --git a/wezterm-gui/src/termwindow/mod.rs b/wezterm-gui/src/termwindow/mod.rsindex 069d148b..aa988931 100644--- a/wezterm-gui/src/termwindow/mod.rs+++ b/wezterm-gui/src/termwindow/mod.rs@@ -467,18 +467,24 @@ const CONTENT_VIEW_FADE: Duration = Duration::from_millis(140);/// registers as a jump rather than as travel.const CONTENT_VIEW_TRAVEL: Duration = Duration::from_millis(260);-/// How long the travelling terminal takes to dissolve into the card's own+/// How long the travelling terminal takes to give way to the card's own/// thumbnail of it, once the two are close enough in size to overlap.///-/// Long enough to be seen, which is a lower bound with real teeth: a timeline-/// does not start its clock until the frame after it is armed, so a dissolve-/// budgeted at 45ms spent one frame arming and left two usable ones. That is a-/// cut with extra steps, and it is what the first version of this shipped as.+/// A cut, on purpose. This was a 140ms dissolve on the belief that the two+/// pictures align exactly once the terminal has settled into the card. They+/// do not: the travelling picture is the terminal as the window drew it,+/// tab strip and all, and the thumbnail is the same rows laid out again at+/// the card's scale, so no glyph lands where its counterpart was. Dissolving+/// two different pictures of dense text shows both at half strength for the+/// length of the dissolve, which on a dark full-screen program reads as the+/// card washing out grey and coming back -- a flash on every open. A cut+/// between two near pictures is a small shift the eye forgives.///-/// Deliberately outlasts the travel. The last stretch of it therefore runs-/// after the terminal has settled into the card, where the two pictures are-/// aligned exactly and the dissolve costs nothing at all.-const CONTENT_VIEW_LANDING_FADE: Duration = Duration::from_millis(140);+/// One frame: a timeline does not start its clock until the frame after it+/// is armed, so this spends that frame opaque over the thumbnail that has+/// just been handed back (see the landing in `advance_content_view_fade`,+/// which waits for the thumbnail to be recorded), and is gone the next.+const CONTENT_VIEW_LANDING_FADE: Duration = Duration::from_millis(1);/// How long the window frame takes to clear its own edges. Shorter than the/// terminal's journey: it only has to get out of the way, and the eye shoulddiff --git a/wezterm-gui/src/termwindow/render/paint.rs b/wezterm-gui/src/termwindow/render/paint.rsindex 8bc91f4e..84863680 100644--- a/wezterm-gui/src/termwindow/render/paint.rs+++ b/wezterm-gui/src/termwindow/render/paint.rs@@ -91,6 +91,8 @@ pub(crate) enum PreviewContentFade {Blank {snapshot: usize,},+ /// Showing content since this instant; the ramp runs from it, so a card+ /// that was never blank is entered with an instant already a ramp ago.ContentSince(Instant),}@@ -1365,22 +1367,39 @@ impl crate::TermWindow {/// sidebar, below the tab bar)./// Advance a full-window view's arrival or departure.fn advance_content_view_fade(&mut self, now: Instant) {+ // Read before the fade is borrowed for advancing; see the landing+ // below for what it gates.+ let flight_thumbnail_recorded = self+ .content_view_fade+ .as_ref()+ .and_then(|fade| fade.flight.as_ref())+ .and_then(|flight| flight.tab_id)+ .map_or(true, |tab_id| self.preview_thumbnail_recorded(tab_id));let Some(fade) = self.content_view_fade.as_mut() else {return;};// Once the travelling terminal has closed to within touching distance- // of its card, hand the card back its own thumbnail and dissolve the- // recording into it. Both pictures are then on screen at the same- // rectangle, which is the only arrangement in which a dissolve reads as- // one thing settling rather than as two things overlapping.+ // of its card, hand the card back its own thumbnail and cut from the+ // recording to it (`CONTENT_VIEW_LANDING_FADE` says why a cut). Both+ // pictures are on screen at the same rectangle for the one frame the+ // cut takes, the recording on top.let mut landed = false;if fade.landing.is_none() && fade.travel.target() >= 0.5 {if let Some(flight) = fade.flight.as_ref() {- if crate::termwindow::content_view::flight_is_landing(- flight.source,- flight.destination,- fade.travel.value(now),- ) {+ // The dissolve needs a thumbnail under it. The card asks for+ // its picture at zero opacity while the terminal is in+ // flight so that it is recorded by now; if it is not -- a+ // slow recording, or a tab with nothing to show -- the+ // terminal holds at the card, opaque, until it is, and no+ // longer than the travel itself once that has ended.+ let thumbnail_ready = flight_thumbnail_recorded || !fade.travel.is_running();+ if thumbnail_ready+ && crate::termwindow::content_view::flight_is_landing(+ flight.source,+ flight.destination,+ fade.travel.value(now),+ )+ {fade.landing = Some(crate::ui::anim::Timeline::new(now,1.0,@@ -1965,6 +1984,18 @@ impl crate::TermWindow {Ok(())}+ /// Whether `tab_id`'s thumbnail has a complete recording to replay: an+ /// entry in the quad cache, and no rebuild of it sliced across frames+ /// still under way.+ fn preview_thumbnail_recorded(&self, tab_id: TabId) -> bool {+ self.preview_quad_cache.borrow().contains_key(&tab_id)+ && !self+ .preview_rebuild_partial+ .borrow()+ .as_ref()+ .is_some_and(|partial| partial.tab_id == tab_id)+ }+/// The opacity a card's picture should draw at this frame: 1.0 for a/// settled card, ramping 0->1 across [`PREVIEW_CONTENT_FADE`] from the/// moment its terminal first shows visible content. Requests further@@ -1975,7 +2006,18 @@ impl crate::TermWindow {let mut fades = self.preview_content_fade.borrow_mut();let entry = fades.entry(preview.tab_id).or_insert_with(|| {if preview.snapshot.has_content() {- PreviewContentFade::ContentSince(now)+ // A card first seen with its picture already there is+ // settled from the start. Fading it in ran against the+ // landing dissolve of the overview's open: the terminal+ // flying into its card is handed back to the thumbnail on+ // the frame the dissolve begins, and a thumbnail rising+ // from zero under a picture sinking to zero left the panel+ // showing through at the crossing -- a washed-out flash on+ // every open. The ramp is for a blank card whose rows+ // arrive later, which is the edge below.+ PreviewContentFade::ContentSince(+ now.checked_sub(PREVIEW_CONTENT_FADE).unwrap_or(now),+ )} else {PreviewContentFade::Blank {snapshot: snapshot_ptr,