lxqt / qtermwidget

The terminal widget for QTerminal
https://lxqt.github.io
GNU General Public License v2.0
485 stars 247 forks source link

Added a keytab that fixes the backspace and ctrl-backspace behaviour #547

Open antis81 opened 2 months ago

antis81 commented 2 months ago

The original default.keytab file breaks the behaviour of the backspace key (for Linux at least) so that QTerminal behaves in an incompatible way to other terminal emulators (like Konsole, Gnome Terminal and the like).

This becomes especially prominent in "user friendly" shells like zsh, fish and the like as they make use of word-wise navigation a lot. In bash this is less prominent, but also produces side-effects…

Although a common workaround method editing the zsh, fish, … configuration files is not a good idea. This method introduces additional interoperability issues with system terminal (tty). However here is an example of a modfied .zshrc for reference.

# QTerminal backspace fix
# bindkey '^H' backward-delete-char          # Backspace         -> delete last char
# bindkey '^?' backward-kill-word            # Ctrl+Backspace    -> delete last word

(note this modificatiion breaks tty (system terminal) interoperability)

With this additional default-backspace-fix.keytab file this will become selectable and just work as expected by users (and it is more likely people will find it).

Related issues:

To help with reviewing the changes the following diff-line can be used (from the qtermwidget directory):

diff --color=always --side-by-side lib/default.keytab lib/kb-layouts/default-backspace-fix.keytab |less -R