From 9976553891c5b671aac6eff30a759e51f88b326b Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 15:58:57 -0700 Subject: [PATCH] Fix space repeating in terminal (cherry-pick #20877) (#20879) Cherry-picked Fix space repeating in terminal (#20877) This is broken because of the way we try to emulate macOS's ApplePressAndHoldEnabled. Release Notes: - Fixed holding down space in the terminal (preview only) Co-authored-by: Conrad Irwin --- crates/gpui/src/platform/mac/events.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/mac/events.rs b/crates/gpui/src/platform/mac/events.rs index aeff08ada87c18b1f557a4fe4a24bebed51bd9e1..51716cccb4e2ecfe5c55f17214ff2f54ffe7a7a3 100644 --- a/crates/gpui/src/platform/mac/events.rs +++ b/crates/gpui/src/platform/mac/events.rs @@ -260,7 +260,10 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke { #[allow(non_upper_case_globals)] let key = match first_char { - Some(SPACE_KEY) => "space".to_string(), + Some(SPACE_KEY) => { + ime_key = Some(" ".to_string()); + "space".to_string() + } Some(BACKSPACE_KEY) => "backspace".to_string(), Some(ENTER_KEY) | Some(NUMPAD_ENTER_KEY) => "enter".to_string(), Some(ESCAPE_KEY) => "escape".to_string(),