diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-02-08 01:46:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-08 01:46:56 +0000 |
commit | 153f9257b8a78432e9a7830f1eb3c539716f6724 (patch) | |
tree | ba95997690427db9526adb77e7a5276bf2017a35 /src | |
parent | 35efb4619c4b7a77b3c30de763856bc4441e236e (diff) | |
download | alacritty-153f9257b8a78432e9a7830f1eb3c539716f6724.tar.gz alacritty-153f9257b8a78432e9a7830f1eb3c539716f6724.zip |
Change shift+pgup/pgdown to scroll history
The default shift+pgup/pgdown buttons were sending the escape sequences
specified by the official standard, however most terminal emulators like
XTerm, URxvt and VTE make an exception for this special case and instead
scroll the native history buffer.
Both XTerm and URxvt do never send the escapes for Shift+PgUp/PgDown,
however VTE does send them in the alternate screen.
Since Alacritty already supports keybindings based on terminal mode and
the binding to scroll the history is useless when in the alternate
screen buffer, Alacritty is now following VTEs behavior here, allowing
applications in the alt screen (like vim) to handle this escape.
Fixes #1989.
Diffstat (limited to 'src')
-rw-r--r-- | src/config/bindings.rs | 6 | ||||
-rw-r--r-- | src/config/mod.rs | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/config/bindings.rs b/src/config/bindings.rs index 9bbd496c..2cf22de9 100644 --- a/src/config/bindings.rs +++ b/src/config/bindings.rs @@ -72,10 +72,12 @@ pub fn default_key_bindings() -> Vec<KeyBinding> { Key::Home, ~TermMode::APP_CURSOR; Action::Esc("\x1b[H".into()); Key::End, +TermMode::APP_CURSOR; Action::Esc("\x1bOF".into()); Key::End, ~TermMode::APP_CURSOR; Action::Esc("\x1b[F".into()); - Key::PageUp, [shift: true]; Action::Esc("\x1b[5;2~".into()); + Key::PageUp, [shift: true], ~TermMode::ALT_SCREEN; Action::ScrollPageUp; + Key::PageUp, [shift: true], +TermMode::ALT_SCREEN; Action::Esc("\x1b[5;2~".into()); Key::PageUp, [ctrl: true]; Action::Esc("\x1b[5;5~".into()); Key::PageUp; Action::Esc("\x1b[5~".into()); - Key::PageDown, [shift: true]; Action::Esc("\x1b[6;2~".into()); + Key::PageDown, [shift: true], ~TermMode::ALT_SCREEN; Action::ScrollPageDown; + Key::PageDown, [shift: true], +TermMode::ALT_SCREEN; Action::Esc("\x1b[6;2~".into()); Key::PageDown, [ctrl: true]; Action::Esc("\x1b[6;5~".into()); Key::PageDown; Action::Esc("\x1b[6~".into()); Key::Tab, [shift: true]; Action::Esc("\x1b[Z".into()); diff --git a/src/config/mod.rs b/src/config/mod.rs index 4ff0cb78..3f0cd0bb 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -937,6 +937,8 @@ impl<'a> de::Deserialize<'a> for ModeWrapper { "~AppCursor" => res.not_mode |= mode::TermMode::APP_CURSOR, "AppKeypad" => res.mode |= mode::TermMode::APP_KEYPAD, "~AppKeypad" => res.not_mode |= mode::TermMode::APP_KEYPAD, + "~Alt" => res.not_mode |= mode::TermMode::ALT_SCREEN, + "Alt" => res.mode |= mode::TermMode::ALT_SCREEN, _ => error!("Unknown mode {:?}", modifier), } } |