From 1e4963e72738d86f1f4397e3b99f4cff95d42bbb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 22 Feb 2018 13:51:14 +0530 Subject: [PATCH] Revert change to make alt+bs emit werase Most linux terminals emit ESC+BS instead. And iTerm2 in Esc+ mode also emits this. So go with the majority for greatest ecosystem compatibility. Fixes #264 --- kitty/keys.h | 16 ++++++++-------- kitty/keys.py | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/kitty/keys.h b/kitty/keys.h index 31840a411..afa4184ee 100644 --- a/kitty/keys.h +++ b/kitty/keys.h @@ -928,7 +928,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x02\x1b\x09"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x33\x7e"; case 55: // DELETE @@ -1079,7 +1079,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x03\x1b\x5b\x5a"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x34\x7e"; case 55: // DELETE @@ -2134,7 +2134,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x02\x1b\x09"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x33\x7e"; case 55: // DELETE @@ -2285,7 +2285,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x03\x1b\x5b\x5a"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x34\x7e"; case 55: // DELETE @@ -3348,7 +3348,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x02\x1b\x09"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x33\x7e"; case 55: // DELETE @@ -3499,7 +3499,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x03\x1b\x5b\x5a"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x34\x7e"; case 55: // DELETE @@ -4554,7 +4554,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x02\x1b\x09"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x33\x7e"; case 55: // DELETE @@ -4705,7 +4705,7 @@ key_lookup(uint8_t key, KeyboardMode mode, uint8_t mods, uint8_t action) { case 52: // TAB return "\x03\x1b\x5b\x5a"; case 53: // BACKSPACE - return "\x01\x17"; + return "\x02\x1b\x7f"; case 54: // INSERT return "\x06\x1b\x5b\x32\x3b\x34\x7e"; case 55: // DELETE diff --git a/kitty/keys.py b/kitty/keys.py index 0ce54e6b0..73e564c42 100644 --- a/kitty/keys.py +++ b/kitty/keys.py @@ -30,8 +30,7 @@ alt_codes = { defines.GLFW_KEY_TAB: b'\033\t', defines.GLFW_KEY_ENTER: b'\033\r', defines.GLFW_KEY_ESCAPE: b'\033\033', - # alt+bs matches iTerm and gnome-terminal - defines.GLFW_KEY_BACKSPACE: b'\x17' + defines.GLFW_KEY_BACKSPACE: b'\033\177' } shift_alt_codes = alt_codes.copy() shift_alt_codes[defines.GLFW_KEY_TAB] = key_as_bytes('kcbt')