From 313fabd7477b97b1817e4f1f5cc212133b9504cd Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 15 Oct 2022 09:14:42 -0700 Subject: [PATCH] keys: ctrl-shift-1 didn't switch to the first tab When using `key_map_preference="Mapped"`, `ctrl-shift-1` is actually `ctrl-shift-!` in a US layout. This commit adds the us-layout mapping for shifted number keys to allow that to work, but it is worth calling out that this will only be meaningful in layouts that have the same US mapping for the number keys. refs: https://github.com/wez/wezterm/issues/2623 --- docs/changelog.md | 4 ++++ wezterm-gui/src/commands.rs | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index d7f5c3050..5b03b7529 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -94,6 +94,10 @@ As features stabilize some brief notes about them will accumulate here. [#2572](https://github.com/wez/wezterm/issues/2572) * Panic when hitting enter in launcher menu when no fuzzy results match [#2629](https://github.com/wez/wezterm/issues/2629) +* Default `CTRL-SHIFT-` assignments didn't work on Windows and X11 + systems when `key_map_preference = "Mapped"` + [#2623](https://github.com/wez/wezterm/issues/2623) + #### Changed * Removed Last Resort fallback font diff --git a/wezterm-gui/src/commands.rs b/wezterm-gui/src/commands.rs index c95884214..b42e2c4ac 100644 --- a/wezterm-gui/src/commands.rs +++ b/wezterm-gui/src/commands.rs @@ -30,8 +30,16 @@ pub enum ArgType { /// a handful of default assignments in the command DEFS below. fn us_layout_shift(s: &str) -> String { match s { - "0" => ")".to_string(), + "1" => "!".to_string(), + "2" => "@".to_string(), + "3" => "#".to_string(), + "4" => "$".to_string(), "5" => "%".to_string(), + "6" => "^".to_string(), + "7" => "&".to_string(), + "8" => "*".to_string(), + "9" => "(".to_string(), + "0" => ")".to_string(), "[" => "{".to_string(), "]" => "}".to_string(), "=" => "+".to_string(),