SSH & special keys
I noticed that the default RedHat distributions work really well with keyboards – for example, the 'Home' and 'End' keys function as exepcted while I'm typing at a shell prompt.
It's a little different under Debian, and I'd imagine I have to install something to get the same functionality. Does anyone know what I have to install/change to set that up in a Debian environment? Currently the 'Home' and 'End' keys result in a "~" character with a beep that occurs at the same time. Interestingly, however, in nano-editor, the Home and End keys work just fine.
Thanks for your help!
j.
4 Replies
case $TERM in
xterm*)
if [ "$COLORTERM" ]; then
bind '"\C-h": backward-delete-char'
bind '"\e[3~": delete-char'
bind '"\e[7~": beginning-of-line'
bind '"\e[8~": end-of-line'
else
bind '"\e[1~": beginning-of-line'
bind '"\e[3~": delete-char'
bind '"\e[4~": end-of-line'
bind '"\177": backward-delete-char'
fi
;;
cons*)
export COLORTERM=$TERM
bind '"\C-?": delete-char' # DEL
bind '"\C-h": backward-delete-char' # BACKSPACE
bind '"\e[H": beginning-of-line' # HOME
bind '"\e[F": end-of-line' # END
esac
You'll have to re-login for it to take effect.
Any idea why it wouldn't have changed anything? The 'Del' key has always worked, the 'Insert' key doesn't, the 'Home' and 'End' keys still give the beep and the '~' character.
Should I try pasting that code into ~/.bashrc? Or would that do bad things?
Thanks again for your help!
j.