From 694fec0d5df8c64e705df74843bb8ba940f062e3 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 9 Dec 2020 17:17:20 -0800 Subject: [PATCH] wezterm: normalize configured keys To avoid confusing behavior, normalize the configured keys in the same way that we normalize key presses. In other words, this: ```lua { key = "y", mods = "CTRL|SHIFT", action = "Copy", } ``` is treated as if you wrote: ```lua { key = "Y", mods = "CTRL", action = "Copy", } ``` refs: https://github.com/wez/wezterm/issues/372 --- config/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/src/lib.rs b/config/src/lib.rs index 7b53b53f1..fe3e03db2 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -992,7 +992,8 @@ impl Config { let mut map = HashMap::new(); for k in &self.keys { - map.insert((k.key.clone(), k.mods), k.action.clone()); + let (key, mods) = k.key.normalize_shift(k.mods); + map.insert((key, mods), k.action.clone()); } Ok(map)