alacritty

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit c47c52d8444bb30e72fc11a99e7ab34561f09740
parent e1ee890750f2b18acd8e37cca105cfcb150fd2ca
Author: skliew <skliew@gmail.com>
Date:   Thu, 20 Dec 2018 08:33:42 +0800

Send alt key with actual key in one flush

The delay between the alt key and the actual received key might cause
certain key sequences to be missed, ex. when tmux has its escape-time
set to 0.
Diffstat:
MCHANGELOG.md | 1+
Msrc/input.rs | 8++++----
2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix color issue in ncurses programs by updating terminfo pairs from 0x10000 to 0x7FFF - Fix panic after quitting Alacritty on macOS - Tabs are no longer replaced by spaces when copying them to the clipboard +- Alt modifier is no longer sent separately from the modified key ## Version 0.2.4 diff --git a/src/input.rs b/src/input.rs @@ -687,16 +687,16 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { self.ctx.clear_selection(); let utf8_len = c.len_utf8(); - if *self.ctx.received_count() == 0 && self.ctx.last_modifiers().alt && utf8_len == 1 { - self.ctx.write_to_pty(b"\x1b".to_vec()); - } - let mut bytes = Vec::with_capacity(utf8_len); unsafe { bytes.set_len(utf8_len); c.encode_utf8(&mut bytes[..]); } + if *self.ctx.received_count() == 0 && self.ctx.last_modifiers().alt && utf8_len == 1 { + bytes.insert(0, b'\x1b'); + } + self.ctx.write_to_pty(bytes); *self.ctx.received_count() += 1;