diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-29 23:14:38 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-29 23:14:38 +0300 |
| commit | eec56a56a9f891de7a130536044a3ff875af0567 (patch) | |
| tree | 7773a1ea64718c0bdd7a833a556fc7dba2748f12 /src/app/mod.rs | |
| parent | ded6d7bfa6d18fecbaba826837c586a4603cfdb5 (diff) | |
fix: restore double prefix passthrough in client mode
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index 3d588403..9e437e62 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -784,7 +784,7 @@ impl App { let key_event = key.as_key_event(); match self.state.mode { Mode::Navigate => { - input::handle_navigate_key(&mut self.state, key_event); + self.handle_navigate_key(key); } Mode::RenameWorkspace | Mode::RenameTab => { input::handle_rename_key(&mut self.state, key_event); @@ -1586,6 +1586,28 @@ mod tests { } #[tokio::test] + async fn route_client_input_double_prefix_passes_prefix_through_to_focused_pane() { + let mut app = test_app(); + let mut workspace = Workspace::test_new("test"); + let focused = workspace.focused_pane_id().unwrap(); + let (runtime, mut rx) = PaneRuntime::test_with_channel(80, 24); + workspace.tabs[0].runtimes.insert(focused, runtime); + app.state.workspaces = vec![workspace]; + app.state.active = Some(0); + app.state.selected = 0; + app.state.mode = Mode::Terminal; + app.state.prefix_code = KeyCode::Char('l'); + app.state.prefix_mods = KeyModifiers::CONTROL; + + app.route_client_input(vec![0x0c]); + assert_eq!(app.state.mode, Mode::Navigate); + + app.route_client_input(vec![0x0c]); + assert_eq!(app.state.mode, Mode::Terminal); + assert_eq!(rx.recv().await.unwrap(), bytes::Bytes::from(vec![0x0c])); + } + + #[tokio::test] async fn route_client_input_reencodes_terminal_keys_for_focused_pane_protocol() { let mut app = test_app(); let mut workspace = Workspace::test_new("test"); |
