diff options
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/mod.rs | 23 | ||||
| -rw-r--r-- | src/app/state.rs | 11 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index b87eec66..5cc40ecc 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -153,6 +153,21 @@ fn agent_panel_scope_from_config( } } +/// Parse the configured agent name list into a deduplicated set of `Agent` +/// values. Unknown agent names are silently dropped so a typo cannot disable +/// other valid entries. +fn parse_cjk_ime_agents(names: &[String]) -> Vec<crate::detect::Agent> { + let mut out = Vec::with_capacity(names.len()); + for name in names { + if let Some(agent) = crate::detect::parse_agent_label(name) { + if !out.contains(&agent) { + out.push(agent); + } + } + } + out +} + /// Resolve the palette from config: base theme + optional custom overrides. fn resolve_palette(config: &crate::config::Config) -> state::Palette { resolve_palette_with_legacy_accent(config, true) @@ -412,6 +427,9 @@ impl App { confirm_close: config.ui.confirm_close, prompt_new_tab_name: config.ui.prompt_new_tab_name, show_agent_labels_on_pane_borders: config.ui.show_agent_labels_on_pane_borders, + reveal_hidden_cursor_for_cjk_ime: config.experimental.reveal_hidden_cursor_for_cjk_ime, + cjk_ime_agents: parse_cjk_ime_agents(&config.experimental.cjk_ime_agents), + cjk_ime_cursor_shape: config.experimental.cjk_ime_cursor_shape.to_decscusr(), kitty_graphics_enabled: config.experimental.kitty_graphics, default_shell: config.terminal.default_shell.clone(), pane_scrollback_limit_bytes: config.advanced.scrollback_limit_bytes, @@ -887,6 +905,11 @@ impl App { if was_kitty_graphics_enabled && !config.experimental.kitty_graphics { let _ = crate::kitty_graphics::clear_all_host_graphics(); } + self.state.reveal_hidden_cursor_for_cjk_ime = + config.experimental.reveal_hidden_cursor_for_cjk_ime; + self.state.cjk_ime_agents = parse_cjk_ime_agents(&config.experimental.cjk_ime_agents); + self.state.cjk_ime_cursor_shape = + config.experimental.cjk_ime_cursor_shape.to_decscusr(); } if !invalid_section("advanced") { diff --git a/src/app/state.rs b/src/app/state.rs index 7ee79c4a..1566fdeb 100644 --- a/src/app/state.rs +++ b/src/app/state.rs @@ -965,6 +965,14 @@ pub struct AppState { pub confirm_close: bool, pub prompt_new_tab_name: bool, pub show_agent_labels_on_pane_borders: bool, + /// Expose the focused pane's cursor anchor to the outer terminal even when + /// the pane requested `?25l`. See `[experimental] reveal_hidden_cursor_for_cjk_ime`. + pub reveal_hidden_cursor_for_cjk_ime: bool, + /// Restrict cursor reveal to focused panes whose detected agent matches + /// one of these. Empty means apply to any focused pane. + pub cjk_ime_agents: Vec<crate::detect::Agent>, + /// DECSCUSR shape parameter (1–6) for the IME anchor cursor. + pub cjk_ime_cursor_shape: u8, pub kitty_graphics_enabled: bool, pub default_shell: String, pub pane_scrollback_limit_bytes: usize, @@ -1224,6 +1232,9 @@ impl AppState { confirm_close: true, prompt_new_tab_name: true, show_agent_labels_on_pane_borders: false, + reveal_hidden_cursor_for_cjk_ime: false, + cjk_ime_agents: Vec::new(), + cjk_ime_cursor_shape: 2, // steady_block kitty_graphics_enabled: false, default_shell: String::new(), pane_scrollback_limit_bytes: crate::config::DEFAULT_SCROLLBACK_LIMIT_BYTES, |
