From 8536d1313ca0ebbaf3aad47bb8af6bedac863e56 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 2 Feb 2024 10:59:40 -0700 Subject: [PATCH] Revert "x11: scope the cyrillic ctrl-c workaround to cyrillic" This reverts commit 15da2e64c27b282d55708d6514dd8aa0040cc7d4. Let's back this out; I think I was too hasty and didn't fully compare behavior with xterm prior to working on this. refs: https://github.com/wez/wezterm/issues/4933 --- docs/changelog.md | 2 -- window/src/os/x11/keyboard.rs | 10 ++-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index e477700b0..a4ec8affa 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -37,8 +37,6 @@ As features stabilize some brief notes about them will accumulate here. path to the command would fail with an obscure error message. #4920 * x11: incorrect handling of the space key when `grp:win_space_toggle` was enabled via `setxkbmap`. #4910 -* x11: ctrl/shift/alt-modified punctuation could expand to the US-english - version of a key. #4933 ### 20240128-202157-1e552d76 diff --git a/window/src/os/x11/keyboard.rs b/window/src/os/x11/keyboard.rs index 490ec8f85..8fd3edeee 100644 --- a/window/src/os/x11/keyboard.rs +++ b/window/src/os/x11/keyboard.rs @@ -368,12 +368,6 @@ impl KeyboardWithFallback { let key_code_from_sym = keysym_to_keycode(sym.into()).or_else(|| keysym_to_keycode(xsym.into())); - fn is_cyrillic(c: char) -> bool { - // - let c = c as u32; - c >= 0x400 && c <= 0x52f - } - // If we have a modified key, and its expansion is non-ascii, such as cyrillic // "Es" (which appears visually similar to "c" in latin texts), then consider // this key expansion against the default latin layout. @@ -384,8 +378,8 @@ impl KeyboardWithFallback { .intersects(Modifiers::CTRL | Modifiers::ALT | Modifiers::SUPER) { match key_code_from_sym { - Some(crate::KeyCode::Char(c)) if is_cyrillic(c) => { - // A Cyrillic layout. + Some(crate::KeyCode::Char(c)) if !c.is_ascii() => { + // Potentially a Cyrillic or other non-european layout. // Consider shortcuts like CTRL-C against the default // latin layout match fallback_feed {