1
0
Fork 0
mirror of https://github.com/alacritty/alacritty.git synced 2024-11-18 13:55:23 -05:00

Add Insert/Delete bindings with combined modifiers

Fixes #3046.
This commit is contained in:
Kirill Chibisov 2019-11-28 23:18:22 +03:00 committed by Christian Duerr
parent 1836d4679a
commit 0d637a096a
2 changed files with 33 additions and 24 deletions

View file

@ -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

View file

@ -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());