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
client: keep the line cache bounded across invalidation and live resize
RoversXad0858aa79b8
diff --git a/wezterm-client/src/pane/renderable.rs b/wezterm-client/src/pane/renderable.rsindex 5c5d20b4..98f9dfba 100644--- a/wezterm-client/src/pane/renderable.rs+++ b/wezterm-client/src/pane/renderable.rs@@ -193,7 +193,9 @@ fn invalidate_line_entries(lines: &mut LruCache<StableRowIndex, LineEntry>, presreturn;}- let mut stale = LruCache::unbounded();+ // Keep the original bound: an unbounded rebuild left the cache free to+ // grow with every fetched line for the rest of the pane's life.+ let mut stale = LruCache::new(lines.cap());while let Some((stable_row, entry)) = lines.pop_lru() {match entry {LineEntry::Stale(line)@@ -212,7 +214,7 @@ fn invalidate_line_entries(lines: &mut LruCache<StableRowIndex, LineEntry>, pres/// painted. Cropping/padding a prior complete row is preferable to either a/// blank flash or mixing old-width storage with newly fetched cells.fn resize_stale_line_entries(lines: &mut LruCache<StableRowIndex, LineEntry>, cols: usize) {- let mut stale = LruCache::unbounded();+ let mut stale = LruCache::new(lines.cap());while let Some((stable_row, entry)) = lines.pop_lru() {let line = match entry {LineEntry::Stale(line)@@ -1545,6 +1547,18 @@ mod test {);}+ #[test]+ fn invalidation_and_live_resize_keep_the_cache_bounded() {+ let mut lines = LruCache::new(NonZeroUsize::new(8).unwrap());+ lines.put(1, LineEntry::Line(line(80)));++ invalidate_line_entries(&mut lines, true);+ assert_eq!(lines.cap().get(), 8);++ resize_stale_line_entries(&mut lines, 37);+ assert_eq!(lines.cap().get(), 8);+ }+#[test]fn width_changing_invalidation_clears_every_cached_line() {let mut lines = LruCache::new(NonZeroUsize::new(8).unwrap());