diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-15 02:32:52 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-15 02:32:52 +0300 |
| commit | 88370e1516182ab519d22a12fa82d5780a40fee6 (patch) | |
| tree | b07be9b77abe14cdd3c1ff0e9acc1268729d8723 /src/app/mod.rs | |
| parent | 5d24d0d214d05858e344a9e15a63856dc1328eae (diff) | |
feat: add isolated pane graphics streaming
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index f32d7785..7391d7d3 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -656,11 +656,15 @@ impl App { integration_install_messages: Vec::new(), installed_plugins: load_plugin_registry(no_session), plugin_panes: std::collections::HashMap::new(), + pane_graphics_layers: std::collections::HashMap::new(), + pane_graphics_streams: std::collections::HashMap::new(), + pane_graphics_revision: 0, plugin_command_logs: Vec::new(), next_plugin_command_log_id: 1, plugin_commands_in_flight: 0, global_menu: state::MenuListState::new(0), host_terminal_theme: crate::terminal_theme::TerminalTheme::default(), + host_cell_size: crate::kitty_graphics::HostCellSize::default(), session_dirty: false, terminal_runtime_shutdowns: Vec::new(), }; @@ -1026,7 +1030,14 @@ impl App { terminal.draw(|frame| { let area = frame.area(); if kitty_graphics_enabled { - cell_size = crate::kitty_graphics::HostCellSize::from_terminal(area); + let observed_cell_size = + crate::kitty_graphics::HostCellSize::try_from_terminal(area); + if let Some(observed_cell_size) = observed_cell_size { + self.state.host_cell_size = observed_cell_size; + } + cell_size = observed_cell_size.unwrap_or_else(|| { + crate::kitty_graphics::HostCellSize::fallback_for_area(area) + }); crate::ui::compute_view_with_cell_size( &mut self.state, &self.terminal_runtimes, @@ -1426,6 +1437,9 @@ impl App { crate::kitty_graphics::set_enabled(config.experimental.kitty_graphics); if was_kitty_graphics_enabled && !config.experimental.kitty_graphics { let _ = crate::kitty_graphics::clear_all_host_graphics(); + self.state.pane_graphics_layers.clear(); + self.state.pane_graphics_streams.clear(); + self.state.host_cell_size = crate::kitty_graphics::HostCellSize::default(); } self.state.reveal_hidden_cursor_for_cjk_ime = config.experimental.reveal_hidden_cursor_for_cjk_ime; |
