You are not logged in.
Another day, another problem. I am using zsh both in the console and in an Xfce terminal window. Some of my homegrown key bindings work in the console but not in Xfce.
After some googling I found a few posts about the "proper" way to do key bindings, basically like this:
typeset -A key
key[Home]=${terminfo[khome]}
... more
# setup key accordingly
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line
... more
# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.
function zle-line-init () {
echoti smkx
}
function zle-line-finish () {
echoti rmkx
}
zle -N zle-line-init
zle -N zle-line-finish
All key bindings work in both environments but the echoti invocations produce error messages in the console (but not in the Xfce terminal emulator window):
echoti: no such terminfo capability: smkx
(or ... rmkx)
I googled for that as well but I wasn't lucky. Anyone an idea what's going on here?
Last edited by t4711 (2012-11-02 11:59:43)
Offline
I switched to zsh today and noticed the same thing. I fixed it by putting the last part in an 'if' block:
if [[ -n ${terminfo[smkx]} ]] && [[ -n ${terminfo[rmkx]} ]]; then
function zle-line-init () {echoti smkx}
function zle-line-finish () {echoti rmkx}
zle -N zle-line-init
zle -N zle-line-finish
fi
Offline
Yeah, I ended up doing sth similar (there are other bits and pieces in my zle-line-init() and zle-line-finish() so your solution, though more efficient, doesn't work for me):
function zle-line-init () {
if (( ${+terminfo[smkx]} )); then
echoti smkx
fi
}
function zle-line-finish () {
if (( ${+terminfo[rmkx]} )); then
echoti rmkx
fi
}
However, I feel this sort of swerves around the problem. Whether that's good enough, I don't know.
(Aside: the number of hoops Linux make you jump through to enable a few basic keys on a bog-standard PC keyboard is quite impressive. And that's nothing to do with Arch itself or The Arch Way: before I decided to go with Arch I tried a plain Debian and a Mint system and the picture was pretty similar.)
Offline
I had the same problem. Debian package seems to do the same, so probably this is the way to go
https://github.com/ft/pkg-zsh/commit/0b … 4f594c2570
https://github.com/ft/pkg-zsh/commit/ab … c320a3fdd9
Offline