1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 19:27:22 +03:00

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
This commit is contained in:
Wez Furlong 2020-12-09 17:17:20 -08:00
parent 35880cf4b1
commit 694fec0d5d

View File

@ -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)