diff options
author | Kirill Chibisov <wchibisovkirill@gmail.com> | 2019-11-28 23:18:22 +0300 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2019-11-28 21:18:22 +0100 |
commit | 0d637a096a53a0b8da2cfb6a8d8a0050cc4f2b34 (patch) | |
tree | 2bd3b3615ff93acaf3c68bb050a760d7e58de054 | |
parent | 1836d4679a4bbbadca49ae103c1eb22aa36ff96e (diff) | |
download | alacritty-0d637a096a53a0b8da2cfb6a8d8a0050cc4f2b34.tar.gz alacritty-0d637a096a53a0b8da2cfb6a8d8a0050cc4f2b34.zip |
Add Insert/Delete bindings with combined modifiers
Fixes #3046.
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | alacritty/src/config/bindings.rs | 53 |
2 files changed, 33 insertions, 24 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f09ad225..d1249ac1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added compatibility logo variants for environments which can't render the default SVG +### Added + +- Terminal escape bindings with combined modifiers for Delete and Insert + ### Fixed - URLs not truncated with non-matching single quote diff --git a/alacritty/src/config/bindings.rs b/alacritty/src/config/bindings.rs index 17a6d0b7..b5680439 100644 --- a/alacritty/src/config/bindings.rs +++ b/alacritty/src/config/bindings.rs @@ -344,53 +344,55 @@ pub fn default_key_bindings() -> Vec<KeyBinding> { let modifiers_code = index + 2; bindings.extend(bindings!( KeyBinding; - Key::Up, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::Delete, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Action::Esc(format!("\x1b[3;{}~", modifiers_code)); + Key::Up, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}A", modifiers_code)); - Key::Down, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::Down, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}B", modifiers_code)); - Key::Right, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::Right, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}C", modifiers_code)); - Key::Left, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::Left, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}D", modifiers_code)); - Key::F1, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F1, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}P", modifiers_code)); - Key::F2, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F2, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}Q", modifiers_code)); - Key::F3, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F3, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}R", modifiers_code)); - Key::F4, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F4, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[1;{}S", modifiers_code)); - Key::F5, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F5, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[15;{}~", modifiers_code)); - Key::F6, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F6, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[17;{}~", modifiers_code)); - Key::F7, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F7, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[18;{}~", modifiers_code)); - Key::F8, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F8, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[19;{}~", modifiers_code)); - Key::F9, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F9, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[20;{}~", modifiers_code)); - Key::F10, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F10, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[21;{}~", modifiers_code)); - Key::F11, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F11, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[23;{}~", modifiers_code)); - Key::F12, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F12, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[24;{}~", modifiers_code)); - Key::F13, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F13, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[25;{}~", modifiers_code)); - Key::F14, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F14, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[26;{}~", modifiers_code)); - Key::F15, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F15, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[28;{}~", modifiers_code)); - Key::F16, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F16, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[29;{}~", modifiers_code)); - Key::F17, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F17, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[31;{}~", modifiers_code)); - Key::F18, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F18, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[32;{}~", modifiers_code)); - Key::F19, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F19, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[33;{}~", modifiers_code)); - Key::F20, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Key::F20, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[34;{}~", modifiers_code)); )); @@ -399,6 +401,8 @@ pub fn default_key_bindings() -> Vec<KeyBinding> { if modifiers_code != 2 { bindings.extend(bindings!( KeyBinding; + Key::Insert, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; + Action::Esc(format!("\x1b[2;{}~", modifiers_code)); Key::PageUp, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; Action::Esc(format!("\x1b[5;{}~", modifiers_code)); Key::PageDown, [shift: mods.shift, alt: mods.alt, ctrl: mods.ctrl]; @@ -454,6 +458,7 @@ pub fn platform_key_bindings() -> Vec<KeyBinding> { Key::Equals, [logo: true]; Action::IncreaseFontSize; Key::Add, [logo: true]; Action::IncreaseFontSize; Key::Minus, [logo: true]; Action::DecreaseFontSize; + Key::Insert, [shift: true]; Action::Esc("\x1b[2;2~".into()); Key::F, [ctrl: true, logo: true]; Action::ToggleFullscreen; Key::K, [logo: true]; Action::ClearHistory; Key::K, [logo: true]; Action::Esc("\x0c".into()); |