summaryrefslogtreecommitdiff
path: root/src/protocol/wire.rs
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-09-14 22:36:04 +0300
committerGitHub <noreply@github.com>2026-09-14 22:36:04 +0300
commitd8b36691d10c6055293ad45324b22af8b8f570e5 (patch)
tree42f6ff4b7ba20a59884a994b38368edd02b16ae2 /src/protocol/wire.rs
parent4c3b613c8470885df44f0844b8eaecca744c84fb (diff)
fix: avoid resending terminal cells for metadata updates (#4137)
Diffstat (limited to 'src/protocol/wire.rs')
-rw-r--r--src/protocol/wire.rs17
1 files changed, 16 insertions, 1 deletions
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<u32>,
}
+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 {