From b5da2e2dacf91da5aad720a81ab5606996586532 Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen Date: Sun, 30 Sep 2018 11:37:20 +0800 Subject: [PATCH] Make Backspace behaves the same as xterm Fixes https://github.com/lxqt/qtermwidget/issues/1 Notes about other terminals: Konsole: ^? for backspace and ^H for ctrl+backspace Gnome Terminal (VTE3): - ^? for backspace and ^H for ctrl+backspace by default, and - ^H for backspace and ^? for ctrl+backspace if the option "Backspace key generates:" is set to "Control-H" --- lib/kb-layouts/default.keytab | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/kb-layouts/default.keytab b/lib/kb-layouts/default.keytab index 6e09e44..e8eacea 100644 --- a/lib/kb-layouts/default.keytab +++ b/lib/kb-layouts/default.keytab @@ -33,8 +33,13 @@ key Return-Shift+NewLine : "\r\n" key Return+Shift : "\EOM" # Backspace and Delete codes are preserving CTRL-H. +# +# Backspace without CTRL sends '^H'; this matches XTerm behaviour +# BS, hex \x08, \b +key Backspace -Control : "\b" -key Backspace : "\x7f" +# Match xterm behaviour: Backspace sends '^?' when Control is pressed +key Backspace +Control : "\x7f" # Arrow keys in VT52 mode # shift up/down are reserved for scrolling.