aboutsummaryrefslogtreecommitdiff
path: root/alacritty
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-10-03 14:27:30 -0600
committerJosh Rahm <rahm@google.com>2021-10-03 14:27:30 -0600
commit1725e30e144b04e2e2e30efc76eb968c97a0eabf (patch)
treeb3bf49887231c918dd395db0852c54b52302e76d /alacritty
parent505bbdb0aa09350a2c52ede96cbacc6e9cf084a2 (diff)
downloadr-alacritty-1725e30e144b04e2e2e30efc76eb968c97a0eabf.tar.gz
r-alacritty-1725e30e144b04e2e2e30efc76eb968c97a0eabf.tar.bz2
r-alacritty-1725e30e144b04e2e2e30efc76eb968c97a0eabf.zip
Relax the ASCII constraint for ALT, and add support for LOGO.
Traditionally only ASCII characters can be sent with the ALT key. This is an arbitrary restriction than I have relaxed. This means now ALT+ñ will produce '^[ñ' on the terminal as expected. I have also added support for the Windows key to send the escapesequence '\x1b@\x1b\' so a mapping can be created in Vim for something like '<M-@><M-\>t' for Windows+t. In addition, it's worth noting that Glutin does not differentiate between the windows key and the hyper key, so if one is relatively perverse like me and has a hyper key, it can be used to sent logo keys to the terminal without X intercepting it.
Diffstat (limited to 'alacritty')
-rw-r--r--alacritty/src/input.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs
index 98a1b723..b8ae4b00 100644
--- a/alacritty/src/input.rs
+++ b/alacritty/src/input.rs
@@ -799,11 +799,18 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
if self.ctx.config().ui_config.alt_send_esc
&& *self.ctx.received_count() == 0
&& self.ctx.modifiers().alt()
- && utf8_len == 1
{
bytes.insert(0, b'\x1b');
}
+ if self.ctx.modifiers().logo()
+ {
+ bytes.insert(0, b'\\');
+ bytes.insert(0, b'\x1b');
+ bytes.insert(0, b'@');
+ bytes.insert(0, b'\x1b');
+ }
+
self.ctx.write_to_pty(bytes);
*self.ctx.received_count() += 1;