diff options
author | Simon Dahlberg <thezic@users.noreply.github.com> | 2019-01-17 22:42:12 +0200 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-01-17 20:42:12 +0000 |
commit | 8b155960708a0ff551c5fc8ec65d2c3c6d12e1da (patch) | |
tree | be24c630e3e967ab9834202679d3de63559287e3 /src/input.rs | |
parent | 0d16478f5d997b6da5488885e15bfb09ca8e7f6d (diff) | |
download | r-alacritty-8b155960708a0ff551c5fc8ec65d2c3c6d12e1da.tar.gz r-alacritty-8b155960708a0ff551c5fc8ec65d2c3c6d12e1da.tar.bz2 r-alacritty-8b155960708a0ff551c5fc8ec65d2c3c6d12e1da.zip |
Add config option to send or not send ESC when ALT-key is pressed
Diffstat (limited to 'src/input.rs')
-rw-r--r-- | src/input.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/input.rs b/src/input.rs index c2473448..65b7b6ce 100644 --- a/src/input.rs +++ b/src/input.rs @@ -49,6 +49,7 @@ pub struct Processor<'a, A: 'a> { pub scrolling_config: &'a config::Scrolling, pub ctx: A, pub save_to_clipboard: bool, + pub alt_send_esc: bool, } pub trait ActionContext { @@ -742,7 +743,11 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { c.encode_utf8(&mut bytes[..]); } - if *self.ctx.received_count() == 0 && self.ctx.last_modifiers().alt && utf8_len == 1 { + if self.alt_send_esc + && *self.ctx.received_count() == 0 + && self.ctx.last_modifiers().alt + && utf8_len == 1 + { bytes.insert(0, b'\x1b'); } @@ -977,6 +982,7 @@ mod tests { key_bindings: &config.key_bindings()[..], mouse_bindings: &config.mouse_bindings()[..], save_to_clipboard: config.selection().save_to_clipboard, + alt_send_esc: config.alt_send_esc(), }; if let Event::WindowEvent { event: WindowEvent::MouseInput { state, button, modifiers, .. }, .. } = $input { |