lxqt / qterminal

A lightweight Qt-based terminal emulator
https://lxqt.github.io
GNU General Public License v2.0
609 stars 152 forks source link

Custom keytab files under home directory #680

Open sschwarzer opened 4 years ago

sschwarzer commented 4 years ago

Thanks for QTerminal. :-)

Expected Behavior

There's a directory under my home directory where QTerminal can pick up custom keytab files. For example, I've created a variant of vt420pc.keytab with the ctrl-left/right definitions from linux.keytab.

Current Behavior

Obviously it's possible to use a custom keytab file - as long as it's put next to the others under /usr/share/qtermwidget5/kb-layouts.

I tried several locations like ~/.config/qterminal.org and ~/.config/qterminal.org/kb-layouts, but the file (literally copied from the directory /usr/share/qtermwidget5/kb-layouts, but with a new name) wasn't used by QTerminal according to the "Preferences"/"Behavior"/"Emulation" setting. I also tried specifying an absolute path in the qterminal.ini file, which wasn't found by QTerminal.

The qtermwidget README mentions a location ~/.kde/share/apps/konsole, but that didn't work for me either.

Possible Solution

Since color schemes under ~/.config/qterminal.org/color-schemes work and this mirrors the directory names under /usr/share/qtermwidget5, it would be "logical" to be able to put custom keytab files under ~/.config/qterminal.org/kb-layouts (and/or possibly directly under ~/.config/qterminal.org). In any case, this possibility should be clearly documented. (In the case of the color scheme it took a lot of research and for the keytab files I also searched a lot, but here to no avail).

Context

The linux.keytab gives me the ctrl-left and ctrl-right combinations to skip words on the bash command line, but some function keys (especially with shift) don't work in Neovim. On the other hand, vt420pc.keytab provides the correct definitions for the function keys, but not for the ctrl-arrow combinations. In that case, for example ctrl-left generates the same sequence as just left.

Mate-Terminal, on the other hand, uses the correct sequences for the function keys and the ctrl-arrow keys. However, it doesn't support ligatures, which is my motivation for the switch to QTerminal.

In my current situation, where I have root access on this computer, I can put the keytab file under /usr/share/qtermwidget5/kb-layouts. However, it would be helpful if there was a custom location that doesn't require root access, for example on a computer not under my control.

System Information
yan12125 commented 4 years ago

User keytab files are not supported yet.

On the other hand, could you try default.keytab? Only that one is maintained. The others are more or less deprecated.

sschwarzer commented 4 years ago

On the other hand, could you try default.keytab? Only that one is maintained. The others are more or less deprecated.

The "Preferences"/"Behavior" dialog says "The default emulation is a fallback with a minimal featureset.", so I may not have tried it. I just did. The ctrl-left/right keys work, also at least some function keys, but not all shift-function keys.

(If only default is maintained and it's more than "minimal", you may consider removing the warning about its "limited featureset". :-) )

yan12125 commented 4 years ago

(If only default is maintained and it's more than "minimal", you may consider removing the warning about its "limited featureset". :-) )

Ah, definitely true! I will update that later.

mralusw commented 3 years ago

Please implement user kb-layouts under $HOME, as qterminal is just about the only terminal that doesn't produce BS = ^? on Debian without a custom kb-layout file (it also happens to be the one I prefer to use.)

This should just be about scanning one directory and (maybe) briefly adding docs, right?