mirror of
https://github.com/alacritty/alacritty.git
synced 2025-04-14 17:53:03 -04:00
Don't send ESC for OptionAsAlt::None
This doesn't solve issue for `RALT`/`LALT`, but that part is impossible until winit's keyboard v2 API.
This commit is contained in:
parent
b0195eb8b7
commit
c82de4ccad
1 changed files with 14 additions and 2 deletions
|
@ -18,7 +18,7 @@ use winit::event::{
|
|||
};
|
||||
use winit::event_loop::EventLoopWindowTarget;
|
||||
#[cfg(target_os = "macos")]
|
||||
use winit::platform::macos::EventLoopWindowTargetExtMacOS;
|
||||
use winit::platform::macos::{EventLoopWindowTargetExtMacOS, OptionAsAlt};
|
||||
use winit::window::CursorIcon;
|
||||
|
||||
use alacritty_terminal::ansi::{ClearMode, Handler};
|
||||
|
@ -868,7 +868,19 @@ impl<T: EventListener, A: ActionContext<T>> Processor<T, A> {
|
|||
let mut bytes = vec![0; utf8_len];
|
||||
c.encode_utf8(&mut bytes[..]);
|
||||
|
||||
if *self.ctx.received_count() == 0 && self.ctx.modifiers().alt() && utf8_len == 1 {
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
let alt_send_esc = true;
|
||||
|
||||
// Don't send ESC when `OptionAsAlt` is used. This doesn't handle
|
||||
// `Only{Left,Right}` variants due to inability to distinguish them.
|
||||
#[cfg(target_os = "macos")]
|
||||
let alt_send_esc = self.ctx.config().window.option_as_alt != OptionAsAlt::None;
|
||||
|
||||
if alt_send_esc
|
||||
&& *self.ctx.received_count() == 0
|
||||
&& self.ctx.modifiers().alt()
|
||||
&& utf8_len == 1
|
||||
{
|
||||
bytes.insert(0, b'\x1b');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue