diff --git a/crates/terminal/src/mappings/keys.rs b/crates/terminal/src/mappings/keys.rs index b003bf82ad368cd9938788b26a037895677f2caa..8073961fc5451728c23582f5eee21495ee002e63 100644 --- a/crates/terminal/src/mappings/keys.rs +++ b/crates/terminal/src/mappings/keys.rs @@ -46,7 +46,7 @@ impl AlacModifiers { pub fn to_esc_str( keystroke: &Keystroke, mode: &TermMode, - alt_is_meta: bool, + option_as_meta: bool, ) -> Option> { let modifiers = AlacModifiers::new(keystroke); @@ -218,7 +218,7 @@ pub fn to_esc_str( } } - if alt_is_meta { + if !cfg!(target_os = "macos") || option_as_meta { let is_alt_lowercase_ascii = modifiers == AlacModifiers::Alt && keystroke.key.is_ascii(); let is_alt_uppercase_ascii = keystroke.modifiers.alt && keystroke.modifiers.shift && keystroke.key.is_ascii(); diff --git a/crates/terminal/src/terminal.rs b/crates/terminal/src/terminal.rs index 8283f5fad77ff3b6a4020db06439714d38bf119b..4f6f0e75ee6f38615a2d82d7a4ad3ee0c06c2323 100644 --- a/crates/terminal/src/terminal.rs +++ b/crates/terminal/src/terminal.rs @@ -1490,14 +1490,14 @@ impl Terminal { } } - pub fn try_keystroke(&mut self, keystroke: &Keystroke, alt_is_meta: bool) -> bool { + pub fn try_keystroke(&mut self, keystroke: &Keystroke, option_as_meta: bool) -> bool { if self.vi_mode_enabled { self.vi_motion(keystroke); return true; } // Keep default terminal behavior - let esc = to_esc_str(keystroke, &self.last_content.mode, alt_is_meta); + let esc = to_esc_str(keystroke, &self.last_content.mode, option_as_meta); if let Some(esc) = esc { match esc { Cow::Borrowed(string) => self.input(string.as_bytes()),