aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorJJ Liebig <jonathan.liebig@gmail.com>2026-09-24 21:00:57 +0200
committerGitHub <noreply@github.com>2026-09-24 21:00:57 +0200
commitafd9e19893db5320b29d73f71f0fad58561f59b0 (patch)
tree7cae6c44b413bdcde580c9b780f6096dab6971f7 /src/client
parentc411883ec639c9893ed9c33021c890485e91727b (diff)
perf: avoid redundant client ANSI encoding work (#4552)
refs #4546
Diffstat (limited to 'src/client')
-rw-r--r--src/client/state.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/state.rs b/src/client/state.rs
index e6b8abf3..2cadfa62 100644
--- a/src/client/state.rs
+++ b/src/client/state.rs
@@ -348,9 +348,11 @@ impl ClientState {
};
crate::render_prof::duration_since("client_surface_patch.encode", encode_started);
let write_started = crate::render_prof::timer();
- let mut stdout = io::stdout();
- stdout.write_all(&encoded.bytes)?;
- stdout.flush()?;
+ if !encoded.bytes.is_empty() {
+ let mut stdout = io::stdout();
+ stdout.write_all(&encoded.bytes)?;
+ stdout.flush()?;
+ }
crate::render_prof::duration_since("client_surface_patch.write", write_started);
let committed = self.blit_encoder.commit_patch(&rows, patch.cursor, encoded);
crate::render_prof::event(if committed {