aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-05-20 03:43:53 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-05-20 03:47:29 +0300
commit38a3c3c5cdb31cae9dab930984d6bea115ede687 (patch)
tree5d58c4b0fe247a3c6d28d200b9c358627a8ccd2f /src/server
parent433d564d03a5d319b91740b5fe1c7c6504be0a12 (diff)
fix: support kitty unicode placeholders
refs #136
Diffstat (limited to 'src/server')
-rw-r--r--src/server/headless.rs21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/server/headless.rs b/src/server/headless.rs
index c84d0abe..49724ffe 100644
--- a/src/server/headless.rs
+++ b/src/server/headless.rs
@@ -245,6 +245,8 @@ struct ClientConnection {
render_state: ClientRenderState,
/// Client-local host Kitty graphics cache.
graphics_cache: crate::kitty_graphics::HostGraphicsCache,
+ /// Whether the next graphics frame must clear and rebuild host-side Kitty state.
+ graphics_surface_reset_pending: bool,
/// Whether a render was skipped because the render channel was full.
render_pending: bool,
/// Last host mouse capture mode sent to this client.
@@ -297,6 +299,7 @@ impl ClientConnection {
last_activity,
render_state: ClientRenderState::new(render_encoding),
graphics_cache: crate::kitty_graphics::HostGraphicsCache::default(),
+ graphics_surface_reset_pending: false,
render_pending: false,
host_mouse_capture_active: None,
staged_clipboard_files: Vec::new(),
@@ -306,6 +309,7 @@ impl ClientConnection {
fn request_full_redraw(&mut self) {
self.render_state.reset_baseline();
+ self.graphics_surface_reset_pending = true;
}
fn request_semantic_redraw_after_input(&mut self) {
@@ -1934,12 +1938,18 @@ impl HeadlessServer {
continue;
};
let mut next_graphics_cache = client.graphics_cache.clone();
+ let graphics_surface_reset_pending = client.graphics_surface_reset_pending;
if is_app_client && self.app.state.kitty_graphics_enabled && cell_size.is_known() {
- frame.graphics = crate::kitty_graphics::encode_local_pane_graphics(
- &self.app.state,
- cell_size,
- &mut next_graphics_cache,
- );
+ if graphics_surface_reset_pending {
+ frame.graphics = next_graphics_cache.clear_bytes();
+ }
+ frame
+ .graphics
+ .extend(crate::kitty_graphics::encode_local_pane_graphics(
+ &self.app.state,
+ cell_size,
+ &mut next_graphics_cache,
+ ));
} else {
frame.graphics = next_graphics_cache.clear_bytes();
}
@@ -2023,6 +2033,7 @@ impl HeadlessServer {
client.render_pending = false;
if commit_graphics_cache {
client.graphics_cache = next_graphics_cache;
+ client.graphics_surface_reset_pending = false;
}
client
.render_state