diff options
| author | akbash <akbash@herdr.dev> | 2026-08-11 23:08:34 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-11 23:08:34 +0300 |
| commit | d004089dee8a51d2083fef1bf58ef66b2b166448 (patch) | |
| tree | 566bad4ae92bf6870b0751e7178d41a7004e37a8 /src/app | |
| parent | 3607453087fdc870b7c6aff5cf64b202f630c513 (diff) | |
fix: disambiguate shifted punctuation keybinds (#2676)
refs #2674
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Co-authored-by: Can Celik <ogulcancelik@gmail.com>
Diffstat (limited to 'src/app')
| -rw-r--r-- | src/app/input/navigate.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/app/input/navigate.rs b/src/app/input/navigate.rs index fd6ef273..beb2f363 100644 --- a/src/app/input/navigate.rs +++ b/src/app/input/navigate.rs @@ -2816,6 +2816,39 @@ resize_pane_left = "prefix+shift+left" } #[test] + fn shifted_backslash_layout_prefers_horizontal_split_binding() { + let config: Config = toml::from_str( + r#" +[keys] +split_vertical = "prefix+|" +split_horizontal = 'prefix+\' +"#, + ) + .unwrap(); + let mut state = state_with_workspaces(&["test"]); + state.keybinds = config.keybinds(); + let key = crate::input::parse_terminal_key_sequence("\x1b[124:92;2:1u").unwrap(); + assert_eq!(key.code, KeyCode::Char('|')); + assert_eq!(key.modifiers, KeyModifiers::SHIFT); + assert_eq!(key.shifted_codepoint, Some('\\' as u32)); + assert!(state.keybinds.split_horizontal.matches_prefix_key(&key)); + assert!(!state.keybinds.split_vertical.matches_prefix_key(&key)); + + assert_eq!( + action_for_key(&state, key, BindingDispatch::Prefix), + Some(NavigateAction::SplitHorizontal) + ); + assert_eq!( + action_for_key( + &state, + TerminalKey::new(KeyCode::Char('|'), KeyModifiers::empty()), + BindingDispatch::Prefix, + ), + Some(NavigateAction::SplitVertical) + ); + } + + #[test] fn prefix_tab_override_can_map_to_last_pane() { let config: Config = toml::from_str( r#" |
