diff options
| author | akbash <akbash@herdr.dev> | 2026-09-13 16:14:31 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-13 15:14:31 +0200 |
| commit | 858ad4e37835d45819f3348d521c29af2fa9eb8d (patch) | |
| tree | 4ffd342b9c9e6b4fa4f2972a93921607fe8b7656 /src/app/api/panes.rs | |
| parent | a5e1c94157ee2d0d25fb92563330d262f2b5d80b (diff) | |
fix(input): preserve super-modified pane keys (#4044)
refs #3710
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Co-authored-by: JJ Liebig <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/app/api/panes.rs')
| -rw-r--r-- | src/app/api/panes.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/app/api/panes.rs b/src/app/api/panes.rs index 9b9a28cc..a025f0b9 100644 --- a/src/app/api/panes.rs +++ b/src/app/api/panes.rs @@ -2696,6 +2696,35 @@ mod tests { } #[tokio::test] + async fn api_pane_send_keys_preserves_super_chord_in_legacy_pane() { + let (mut app, pane_id, mut rx) = app_with_send_key_runtime(1); + let internal_pane_id = app.state.workspaces[0].tabs[0].root_pane; + assert_eq!( + app.lookup_runtime_sender(0, internal_pane_id) + .unwrap() + .keyboard_protocol(), + crate::input::KeyboardProtocol::Legacy + ); + + let response = app.handle_api_request(crate::api::schema::Request { + id: "req".into(), + method: crate::api::schema::Method::PaneSendKeys(PaneSendKeysParams { + pane_id, + keys: vec!["cmd+c".into()], + }), + }); + + let success: SuccessResponse = serde_json::from_str(&response).unwrap(); + assert_eq!(success.id, "req"); + assert_eq!(success.result, ResponseResult::Ok {}); + assert_eq!( + rx.try_recv().unwrap(), + bytes::Bytes::from_static(b"\x1b[99;9u") + ); + assert!(rx.try_recv().is_err()); + } + + #[tokio::test] async fn api_pane_send_keys_accepts_literal_plus() { let (mut app, pane_id, mut rx) = app_with_send_key_runtime(1); |
