1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 21:32:13 +03:00
this makes us consistent in behavior with xterm:

CTRL-H -> 0x08
Backspace -> 0x7f
CTRL-Backspace -> 0x08

refs: #1508
refs: #1495
This commit is contained in:
Wez Furlong 2022-01-06 12:26:58 -07:00
parent ca8362ff08
commit 94a35c9d1e

View File

@ -893,12 +893,6 @@ fn normalize_shift(key: KeyCode, modifiers: Modifiers) -> (KeyCode, Modifiers) {
fn normalize_ctrl(key: KeyCode, modifiers: Modifiers) -> (KeyCode, Modifiers) {
if modifiers.contains(Modifiers::CTRL) {
if let KeyCode::Char(c) = key {
if c == '\u{8}' {
// Leave backspace alone!
// <https://github.com/wez/wezterm/issues/1495>
return (key, modifiers);
}
if (c as u32) < 0x20 {
let de_ctrl = ((c as u8) | 0x40) as char;
return (KeyCode::Char(de_ctrl.to_ascii_lowercase()), modifiers);