diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-06 15:36:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-06 15:36:35 +0200 |
| commit | 5a64e8da4551990367dd26d77cf3b654dfa27a73 (patch) | |
| tree | d7eaf5f4143cb7b0d34bfe73dd3d1ea315fa6c1a /src/client/shell/tests | |
| parent | e366a05f03b6e37549c7a1744c3551553017c541 (diff) | |
fix: consume failed selection copies without interrupting agents (#3681)
Diffstat (limited to 'src/client/shell/tests')
| -rw-r--r-- | src/client/shell/tests/copy.rs | 25 | ||||
| -rw-r--r-- | src/client/shell/tests/endpoint_requests.rs | 10 |
2 files changed, 7 insertions, 28 deletions
diff --git a/src/client/shell/tests/copy.rs b/src/client/shell/tests/copy.rs index 7d71a981..7cc3241b 100644 --- a/src/client/shell/tests/copy.rs +++ b/src/client/shell/tests/copy.rs @@ -224,7 +224,7 @@ fn retained_mouse_selection_copies_only_on_exact_copy_shortcut() { ClientShellAction::Endpoint { request, .. } => request.id.clone(), _ => unreachable!(), }; - let (_, fallback) = state.handle_endpoint_result( + let (_, actions) = state.handle_endpoint_result( "boot-1", &request_id, Ok(crate::api::schema::ResponseResult::PaneSelection { @@ -232,25 +232,10 @@ fn retained_mouse_selection_copies_only_on_exact_copy_shortcut() { text: String::new(), }), ); - assert!(matches!( - &fallback[..], - [ClientShellAction::Request(ClientMessage::ClientShellPaneInput { - pane_id, - events, - })] if pane_id == "pane_1" - && matches!( - &events[..], - [ClientPaneInputEvent::Key { - code: crate::protocol::ClientKeyCode::Char('c'), - kind: crate::protocol::ClientKeyKind::Press, - .. - }, ClientPaneInputEvent::Key { - code: crate::protocol::ClientKeyCode::Char('c'), - kind: crate::protocol::ClientKeyKind::Release, - .. - }] - ) - )); + assert!( + actions.is_empty(), + "failed copy must not send terminal input" + ); } #[test] diff --git a/src/client/shell/tests/endpoint_requests.rs b/src/client/shell/tests/endpoint_requests.rs index 8149b530..ab5a3cb2 100644 --- a/src/client/shell/tests/endpoint_requests.rs +++ b/src/client/shell/tests/endpoint_requests.rs @@ -216,7 +216,7 @@ fn cancelled_integration_install_does_not_queue_a_refresh() { } #[test] -fn cancelled_selection_does_not_replay_its_fallback_key() { +fn cancelled_selection_does_not_send_terminal_input() { let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); state.set_snapshot(Box::new(snapshot())); state.set_pane_surface(surface()); @@ -226,13 +226,7 @@ fn cancelled_selection_does_not_replay_its_fallback_key() { (0, 2), )); let mut outcome = ClientShellInput::default(); - state.request_selection_copy_with_fallback( - &mut outcome, - Some(crate::input::TerminalKey::new( - KeyCode::Char('c'), - KeyModifiers::CONTROL, - )), - ); + state.request_selection_copy(&mut outcome); let (_, actions) = state.handle_endpoint_result( "boot-1", request_id(&outcome.actions), |
