Open antis81 opened 3 years ago
That seems weird. AFAIK your bindkey should be doing the opposite.
My terminal uses ^H
for ctrl+backspace and ^?
for backspace.
To what version number are you referring? nvm, package version :facepalm:
To be fair the description is not complete and - as always - takes a specific situation. For me this is QTerminal (:heart:).
Compared to "native" tty (e.g. Ctrl+Alt+F2
) the story is completely different (:partying_face:):
Commenting my customized bindkey …
lines results in Backspace
working (del. single char) while Ctrl+Backspace
will do nothing at all.
Okay… just compared my env's. The only tty related variables are TERM
and XDG_SESSION_TYPE
.
As you might already know setting the TERM
variable results in a different prompt (no effect on keybindings though :frowning_face:):
TERM=xterm-256color
(prints "branded" Manjaro prompt TERM=xterm
(prints ~ >
prompt) TERM=linux
(also prints ~ >
prompt)Setting XDG_SESSION_TYPE
(tty vs x11) does not have a notable effect on bindings either -> skip it…
Now QTerminal can also set the "emulation behavior" (not sure what "default" means here). Setting this to linux
the issue becomes reproducable (yay :partying_face:). Do you know what "engine" Manjaro sets on TTY? Would be great if we could check on that in the script!
I have the same problem with an out-of-the-box Norwegian keyboard layout. My terminals use ^?
for Ctrl+BackSpace
and ^H
for BackSpace
. It’s the same in Fedora and Ubuntu, for what it’s worth.
@da2x Thanks for mentioning.
Like I tried to outline in my previous comment above this depends on the tty emulation in use. The key-binding is set here.
To make this generic we are searching for some reliable condition that works ideally on all systems. Something like
if [[ … ]]; then
bindkey '^H' backward-delete-char # Backspace -> delete last char
bindkey '^?' backward-kill-word # Ctrl+Backspace -> delete last word
else
bindkey '^H' backward-kill-word # delete previous word with ctrl+backspace
fi
QTerminal (and other terminal emulators) can switch the TTY emulation. May be useful for trying things out manually.
However I don't know directly how the aliases default,macbook,linux,…
map there.
Probably it's just me, but I am used to deleting a single character using the
Backspace
key and a Word usingCtrl+Backspace
. In version0.20-3
the default behaviour is exactly switched. I worked around that: