Skip to content

Commit

Permalink
Implement kitty's keyboard protocol
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kchibisov committed Dec 6, 2023
1 parent 7c9d9f3 commit cb03806
Show file tree
Hide file tree
Showing 7 changed files with 850 additions and 300 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `window.blur` config option to request blur for transparent windows
- `--option` argument for `alacritty msg create-window`
- Support for `DECRQM`/`DECRPM` escape sequences
- Support for kitty's keyboard protocol

### Changed

Expand Down
226 changes: 92 additions & 134 deletions alacritty/src/config/bindings.rs

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions alacritty/src/config/ui_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
}
}

Expand Down
Loading

0 comments on commit cb03806

Please sign in to comment.