From cb03806e2ab85674c45e87e1bb24dfe2fd1a918c Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Wed, 6 Dec 2023 09:26:07 +0400 Subject: Implement kitty's keyboard protocol The protocol enables robust key reporting for the applications, so they could bind more keys and the user won't have collisions with the normal control keys. Links: https://sw.kovidgoyal.net/kitty/keyboard-protocol Fixes #6378. --- alacritty/src/config/ui_config.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'alacritty/src/config/ui_config.rs') diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index a76bbb78..f4f67cb6 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -10,14 +10,15 @@ use log::{error, warn}; use serde::de::{Error as SerdeError, MapAccess, Visitor}; use serde::{self, Deserialize, Deserializer}; use unicode_width::UnicodeWidthChar; -use winit::keyboard::{Key, KeyLocation, ModifiersState}; +use winit::keyboard::{Key, ModifiersState}; use alacritty_config_derive::{ConfigDeserialize, SerdeReplace}; use alacritty_terminal::term::search::RegexSearch; use crate::config::bell::BellConfig; use crate::config::bindings::{ - self, Action, Binding, BindingKey, KeyBinding, ModeWrapper, ModsWrapper, MouseBinding, + self, Action, Binding, BindingKey, KeyBinding, KeyLocation, ModeWrapper, ModsWrapper, + MouseBinding, }; use crate::config::color::Colors; use crate::config::cursor::Cursor; @@ -152,11 +153,12 @@ impl UiConfig { /// Derive [`TermConfig`] from the config. pub fn term_options(&self) -> TermConfig { TermConfig { + semantic_escape_chars: self.selection.semantic_escape_chars.clone(), scrolling_history: self.scrolling.history() as usize, - default_cursor_style: self.cursor.style(), vi_mode_cursor_style: self.cursor.vi_mode_style(), - semantic_escape_chars: self.selection.semantic_escape_chars.clone(), + default_cursor_style: self.cursor.style(), osc52: self.terminal.osc52.0, + kitty_keyboard: true, } } -- cgit