diff options
Diffstat (limited to 'src/client/shell')
| -rw-r--r-- | src/client/shell/actions.rs | 3 | ||||
| -rw-r--r-- | src/client/shell/tests/popup_focus_projection.rs | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/client/shell/actions.rs b/src/client/shell/actions.rs index 12d8cc16..e3885626 100644 --- a/src/client/shell/actions.rs +++ b/src/client/shell/actions.rs @@ -1064,6 +1064,9 @@ impl ClientShellState { pane_id: focused_pane, mode: PaneZoomMode::Toggle, })), + KeybindAction::ClearPane => Some(Method::PaneClear(PaneTarget { + pane_id: focused_pane?, + })), KeybindAction::EditScrollback => Some(Method::PaneEditScrollback(PaneTarget { pane_id: focused_pane?, })), diff --git a/src/client/shell/tests/popup_focus_projection.rs b/src/client/shell/tests/popup_focus_projection.rs index 25d3b334..7f3ea137 100644 --- a/src/client/shell/tests/popup_focus_projection.rs +++ b/src/client/shell/tests/popup_focus_projection.rs @@ -885,6 +885,25 @@ fn pane_scrollbar_track_and_thumb_use_stable_endpoint_scroll_requests() { } #[test] +fn clear_pane_binding_targets_the_focused_endpoint_pane() { + let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); + state.set_snapshot(Box::new(snapshot())); + state.set_pane_surface(surface()); + let mut input = ClientShellInput::default(); + state.record_binding( + crate::input::KeybindMatch::Action(crate::input::KeybindAction::ClearPane), + &mut input, + ); + assert!(input.requests.is_empty()); + assert!(matches!( + &input.actions[..], + [ClientShellAction::Endpoint { request, .. }] + if matches!(&request.method, crate::api::schema::Method::PaneClear(target) + if target.pane_id == "pane_1") + )); +} + +#[test] fn edit_scrollback_binding_targets_the_focused_endpoint_pane() { let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); state.set_snapshot(Box::new(snapshot())); |
