diff options
author | skliew <skliew@gmail.com> | 2018-12-20 08:33:42 +0800 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-12-20 00:33:42 +0000 |
commit | c47c52d8444bb30e72fc11a99e7ab34561f09740 (patch) | |
tree | 5062bd46f084ed3aa1bb0cb245cabe473681a9ac /src | |
parent | e1ee890750f2b18acd8e37cca105cfcb150fd2ca (diff) | |
download | alacritty-c47c52d8444bb30e72fc11a99e7ab34561f09740.tar.gz alacritty-c47c52d8444bb30e72fc11a99e7ab34561f09740.zip |
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 (limited to 'src')
-rw-r--r-- | src/input.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/input.rs b/src/input.rs index 07887ad9..23ccdd58 100644 --- 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; |