From d8b36691d10c6055293ad45324b22af8b8f570e5 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Mon, 14 Sep 2026 22:36:04 +0300 Subject: fix: avoid resending terminal cells for metadata updates (#4137) --- src/protocol/wire.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/protocol/wire.rs') diff --git a/src/protocol/wire.rs b/src/protocol/wire.rs index 052c73a3..a29c6ca6 100644 --- a/src/protocol/wire.rs +++ b/src/protocol/wire.rs @@ -699,7 +699,7 @@ pub enum AttachScrollSource { /// A single cell in a rendered frame, serialized independently from ratatui's /// `Cell` type to keep the wire protocol stable. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct CellData { /// Grapheme cluster displayed in this cell (usually 1–2 chars). pub symbol: String, @@ -715,6 +715,21 @@ pub struct CellData { pub hyperlink: Option, } +impl Clone for CellData { + fn clone(&self) -> Self { + Self { + symbol: self.symbol.clone(), + ..*self + } + } + + fn clone_from(&mut self, source: &Self) { + let mut symbol = std::mem::take(&mut self.symbol); + symbol.clone_from(&source.symbol); + *self = Self { symbol, ..*source }; + } +} + impl CellData { pub(crate) fn from_ratatui_cell(cell: &ratatui::buffer::Cell) -> Self { Self { -- cgit v1.2.3