diff options
| author | Aram Drevekenin <aram@poor.dev> | 2024-05-27 16:15:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-27 16:15:09 +0200 |
| commit | 62c37a87cca5aaa8b0e580b973b93513ed616dba (patch) | |
| tree | 5836dba1572dd4e95cc6e312f82b1ad4f263957e /src/tests | |
| parent | docs(changelog): ooo plugin events fix (diff) | |
| download | sl0ppij-62c37a87cca5aaa8b0e580b973b93513ed616dba.tar.gz sl0ppij-62c37a87cca5aaa8b0e580b973b93513ed616dba.tar.xz sl0ppij-62c37a87cca5aaa8b0e580b973b93513ed616dba.zip | |
feat(keybindings): support multiple modifiers (eg. Ctrl+Alt) and the kitty keyboard protocol (#3383)
* parse kitty keys from STDIN
* work
* work
* replace internal Key representation with the new KeyWithModifier in all the places
* work
* work
* allow disabling with config
* adjust ordering
* handle enabling/disabling properly on the client
* support multiple modifiers without kitty too
* normalize uppercase keys
* get tests to pass
* various cleanups
* style(fmt): rustfmt
Diffstat (limited to 'src/tests')
6 files changed, 12 insertions, 8 deletions
diff --git a/src/tests/e2e/cases.rs b/src/tests/e2e/cases.rs index f2dd0933..6b1c12c6 100644 --- a/src/tests/e2e/cases.rs +++ b/src/tests/e2e/cases.rs @@ -2226,6 +2226,7 @@ pub fn send_command_through_the_cli() { // cursor does not appear in // suspend_start panes { + std::thread::sleep(std::time::Duration::from_millis(100)); remote_terminal.send_key(&SPACE); // run script - here we use SPACE // instead of the default ENTER because // sending ENTER over SSH can be a little @@ -2243,6 +2244,7 @@ pub fn send_command_through_the_cli() { if remote_terminal.snapshot_contains("<Ctrl-c>") && remote_terminal.cursor_position_is(76, 3) { + std::thread::sleep(std::time::Duration::from_millis(100)); remote_terminal.send_key(&SPACE); // re-run script - here we use SPACE // instead of the default ENTER because // sending ENTER over SSH can be a little diff --git a/src/tests/e2e/remote_runner.rs b/src/tests/e2e/remote_runner.rs index 2f93d5b6..ab2c4a9e 100644 --- a/src/tests/e2e/remote_runner.rs +++ b/src/tests/e2e/remote_runner.rs @@ -237,6 +237,7 @@ fn read_from_channel( let debug = false; let arrow_fonts = true; let styled_underlines = true; + let explicitly_disable_kitty_keyboard_protocol = false; let mut terminal_output = TerminalPane::new( 0, pane_geom, @@ -253,6 +254,7 @@ fn read_from_channel( debug, arrow_fonts, styled_underlines, + explicitly_disable_kitty_keyboard_protocol, ); // 0 is the pane index loop { if !should_keep_running.load(Ordering::SeqCst) { diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap index fd55ac42..5308c782 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1048 +assertion_line: 1171 expression: last_snapshot --- Zellij (e2e-test) Tab #1 Tab #2 Tab #3 Tab #4 @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SEARCH <o> SESSION <q> QUIT - (FLOATING PANES VISIBLE): Press Ctrl+p, <w> to hide. + (FLOATING PANES VISIBLE): Press Ctrl p, <w> to hide. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap index f3677360..8c0477f8 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__quit_and_resurrect_session_with_viewport_serialization.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1109 +assertion_line: 1232 expression: last_snapshot --- Zellij (e2e-test) Tab #1 Tab #2 Tab #3 Tab #4 @@ -26,4 +26,4 @@ expression: last_snapshot │ ││ │ └──────────────────────────────────────────────────────────┘└──────────────────────────────────────────────────────────┘ Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SEARCH <o> SESSION <q> QUIT - (FLOATING PANES VISIBLE): Press Ctrl+p, <w> to hide. + (FLOATING PANES VISIBLE): Press Ctrl p, <w> to hide. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__status_bar_loads_custom_keybindings.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__status_bar_loads_custom_keybindings.snap index 974a63bd..a0fe5fbd 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__status_bar_loads_custom_keybindings.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__status_bar_loads_custom_keybindings.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1011 +assertion_line: 1266 expression: last_snapshot --- Zellij (e2e-test) Tab #1 @@ -25,5 +25,5 @@ expression: last_snapshot │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ - <F1> LOCK <F2> PANE <F3> TAB <F4> RESIZE <F5> MOVE <F6> SEARCH <Alt+F7> SESSION <Ctrl+F8> QUIT + <F1> LOCK <F2> PANE <F3> TAB <F4> RESIZE <F5> MOVE <F6> SEARCH <Alt F7> SESSION <Ctrl F8> QUIT Tip: UNBOUND => open new pane. UNBOUND => navigate between panes. UNBOUND => increase/decrease pane size. diff --git a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap index e76aa32a..3007e299 100644 --- a/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap +++ b/src/tests/e2e/snapshots/zellij__tests__e2e__cases__toggle_floating_panes.snap @@ -1,6 +1,6 @@ --- source: src/tests/e2e/cases.rs -assertion_line: 1724 +assertion_line: 1984 expression: last_snapshot --- Zellij (e2e-test) Tab #1 @@ -26,4 +26,4 @@ expression: last_snapshot │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ Ctrl + <g> LOCK <p> PANE <t> TAB <n> RESIZE <h> MOVE <s> SEARCH <o> SESSION <q> QUIT - (FLOATING PANES VISIBLE): Press Ctrl+p, <w> to hide. + (FLOATING PANES VISIBLE): Press Ctrl p, <w> to hide. |
