diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index ba2280b91..2665c5c60 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -850,7 +850,8 @@ impl TerminalState { (Escape, ..) => "\x1b", // Delete (Char('\x7f'), _, _, _, false) | (Delete, _, _, _, false) => "\x7f", - (Char('\x7f'), ..) | (Delete, ..) => "\x1b[3~", + // TODO: application delete key? See https://github.com/wez/wezterm/issues/52 + (Char('\x7f'), _, _, _, true) | (Delete, _, _, _, true) => "\x7f", // "\x1b[3~" (Char(c), CTRL, _, SHIFT, _) if c <= 0xff as char && c > 0x40 as char => { // If shift is held we have C == 0x43 and want to translate diff --git a/termwiz/src/input.rs b/termwiz/src/input.rs index 383eba783..316c478ad 100644 --- a/termwiz/src/input.rs +++ b/termwiz/src/input.rs @@ -560,7 +560,8 @@ impl InputParser { for (keycode, c) in &[ (KeyCode::Insert, b'2'), - (KeyCode::Delete, b'3'), + // TODO: application delete key? See https://github.com/wez/wezterm/issues/52 + // (KeyCode::Delete, b'3'), (KeyCode::Home, b'1'), (KeyCode::End, b'4'), (KeyCode::PageUp, b'5'), @@ -579,7 +580,7 @@ impl InputParser { map.insert( &[0x7f], InputEvent::Key(KeyEvent { - key: KeyCode::Backspace, + key: KeyCode::Delete, modifiers: Modifiers::NONE, }), ); diff --git a/window/src/os/macos/window.rs b/window/src/os/macos/window.rs index d90a4ab5e..a26d341d1 100644 --- a/window/src/os/macos/window.rs +++ b/window/src/os/macos/window.rs @@ -643,8 +643,6 @@ impl WindowView { '\u{f72b}' => KeyCode::End, '\u{f72c}' => KeyCode::PageUp, '\u{f72d}' => KeyCode::PageDown, - // rewrite Del to Backspace - '\u{7f}' => KeyCode::Char('\u{8}'), _ => KeyCode::Char(first_char), } } else {