diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-13 14:14:40 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-13 14:15:26 +0300 |
| commit | 4600309051e5d6bea1f64e72cec585b102117ce5 (patch) | |
| tree | 8ca78803bbef8453bdd2d9a0de312201cd0ee60d /src/app | |
| parent | fb9aff54087aa8a606e9260a689986d2bd76f5fa (diff) | |
feat: support kitty graphics in attached clients
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/mod.rs | 10 | ||||
| -rw-r--r-- | src/app/state.rs | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index 0719dc0c..84b8e72f 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -194,6 +194,7 @@ impl App { event_hub: crate::api::EventHub, ) -> Self { let (prefix_code, prefix_mods) = config.prefix_key(); + crate::kitty_graphics::set_enabled(config.advanced.kitty_graphics); let (event_tx, event_rx) = mpsc::channel::<AppEvent>(64); let render_notify = Arc::new(Notify::new()); let render_dirty = Arc::new(AtomicBool::new(false)); @@ -365,6 +366,7 @@ impl App { agent_panel_scope, confirm_close: config.ui.confirm_close, show_agent_labels_on_pane_borders: config.ui.show_agent_labels_on_pane_borders, + kitty_graphics_enabled: config.advanced.kitty_graphics, pane_scrollback_limit_bytes: config.advanced.scrollback_limit_bytes, accent: crate::config::parse_color(&config.ui.accent), sound: config.ui.sound.clone(), @@ -506,7 +508,11 @@ impl App { crate::ui::compute_view_with_cell_size(&mut self.state, area, cell_size); crate::ui::render(&self.state, frame); })?; - crate::kitty_graphics::paint_local_pane_graphics(&self.state, cell_size)?; + if self.state.kitty_graphics_enabled { + crate::kitty_graphics::paint_local_pane_graphics(&self.state, cell_size)?; + } else { + crate::kitty_graphics::clear_all_host_graphics()?; + } self.last_render_at = Some(now); needs_render = false; continue; @@ -689,6 +695,8 @@ impl App { } if !invalid_section("advanced") { + self.state.kitty_graphics_enabled = config.advanced.kitty_graphics; + crate::kitty_graphics::set_enabled(config.advanced.kitty_graphics); self.state.pane_scrollback_limit_bytes = config.advanced.scrollback_limit_bytes; } diff --git a/src/app/state.rs b/src/app/state.rs index b350235a..c79fbc24 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -711,6 +711,7 @@ pub struct AppState { pub agent_panel_scope: AgentPanelScope, pub confirm_close: bool, pub show_agent_labels_on_pane_borders: bool, + pub kitty_graphics_enabled: bool, pub pane_scrollback_limit_bytes: usize, #[allow(dead_code)] // kept for backward compat; palette.accent is the source of truth pub accent: Color, @@ -878,6 +879,7 @@ impl AppState { agent_panel_scope: AgentPanelScope::AllWorkspaces, confirm_close: true, show_agent_labels_on_pane_borders: false, + kitty_graphics_enabled: false, pane_scrollback_limit_bytes: crate::config::DEFAULT_SCROLLBACK_LIMIT_BYTES, accent: Color::Cyan, sound: SoundConfig { |
