Add keyup/keydown hack for Ubuntu 12.04 & FreeBSD.

This commit is contained in:
Gea-Suan Lin
2014-11-05 19:57:41 +08:00
parent b0a2a95573
commit 733d077ee4

14
.zshrc
View File

@@ -65,6 +65,20 @@ key[Insert]=${terminfo[kich1]}
key[PageDown]=${terminfo[knp]}
key[PageUp]=${terminfo[kpp]}
key[Up]=${terminfo[kcuu1]}
#
# Terminal hack (keyup/keydown) for Ubuntu 12.04 & FreeBSD
if [[ -f /etc/lsb-release ]]; then
source /etc/lsb-release
if [[ "$DISTRIB_RELEASE" == "12.04" ]]; then
key[Down]=""
key[Up]=""
fi
elif [[ "`sysctl kern.ostype 2>&1`" == "FreeBSD" ]]; then
key[Down]=""
key[Up]=""
fi
#
[[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char
[[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line
[[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line