From cc7c696cd0772e466da403eb4e3f00f4e8d8ae1e Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sat, 19 Sep 2026 14:47:18 +0300 Subject: feat: add configurable pane screen and scrollback clearing (#4383) --- src/config/keybinds.rs | 3 +++ src/config/model.rs | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'src/config') diff --git a/src/config/keybinds.rs b/src/config/keybinds.rs index bec1af66..5f4b46de 100644 --- a/src/config/keybinds.rs +++ b/src/config/keybinds.rs @@ -347,6 +347,7 @@ pub struct Keybinds { pub close_tab: ActionKeybinds, pub rename_pane: ActionKeybinds, pub edit_scrollback: ActionKeybinds, + pub clear_pane: ActionKeybinds, pub copy_mode: ActionKeybinds, pub focus_pane_left: ActionKeybinds, pub focus_pane_down: ActionKeybinds, @@ -515,6 +516,7 @@ impl Config { close_tab: empty_action!(), rename_pane: empty_action!(), edit_scrollback: empty_action!(), + clear_pane: empty_action!(), copy_mode: empty_action!(), focus_pane_left: empty_action!(), focus_pane_down: empty_action!(), @@ -662,6 +664,7 @@ impl Config { apply_action!(keybinds.close_tab, close_tab, source); apply_action!(keybinds.rename_pane, rename_pane, source); apply_action!(keybinds.edit_scrollback, edit_scrollback, source); + apply_action!(keybinds.clear_pane, clear_pane, source); apply_action!(keybinds.copy_mode, copy_mode, source); apply_action!(keybinds.focus_pane_left, focus_pane_left, source); apply_action!(keybinds.focus_pane_down, focus_pane_down, source); diff --git a/src/config/model.rs b/src/config/model.rs index 6ef6274d..930df026 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -405,6 +405,7 @@ pub struct KeysConfig { pub rename_pane: BindingConfig, /// Open the focused pane scrollback in $EDITOR. Default: "prefix+e". pub edit_scrollback: BindingConfig, + pub clear_pane: BindingConfig, /// Enter keyboard copy mode for the focused pane. Default: "prefix+[". pub copy_mode: BindingConfig, /// Focus the pane to the left. Default: "prefix+h". @@ -536,6 +537,7 @@ pub(crate) struct KeysConfigOverlay { rename_pane: Option, #[serde(skip_serializing_if = "Option::is_none")] edit_scrollback: Option, + clear_pane: Option, #[serde(skip_serializing_if = "Option::is_none")] copy_mode: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -646,6 +648,7 @@ impl<'de> Deserialize<'de> for KeysConfig { apply_field!(close_tab); apply_field!(rename_pane); apply_field!(edit_scrollback); + apply_field!(clear_pane); apply_field!(copy_mode); apply_field!(focus_pane_left); apply_field!(focus_pane_down); @@ -750,6 +753,7 @@ impl KeysConfig { copy_effective_action_field!(close_tab, keybinds.close_tab); copy_effective_action_field!(rename_pane, keybinds.rename_pane); copy_effective_action_field!(edit_scrollback, keybinds.edit_scrollback); + copy_effective_action_field!(clear_pane, keybinds.clear_pane); copy_effective_action_field!(copy_mode, keybinds.copy_mode); copy_effective_action_field!(focus_pane_left, keybinds.focus_pane_left); copy_effective_action_field!(focus_pane_down, keybinds.focus_pane_down); @@ -1118,6 +1122,7 @@ impl Default for KeysConfig { close_tab: BindingConfig::one("prefix+shift+x"), rename_pane: BindingConfig::one("prefix+shift+p"), edit_scrollback: BindingConfig::one("prefix+e"), + clear_pane: BindingConfig::default(), copy_mode: BindingConfig::one("prefix+["), focus_pane_left: BindingConfig::one("prefix+h"), focus_pane_down: BindingConfig::one("prefix+j"), -- cgit v1.2.3