fix empty history in gnome terminal

This commit is contained in:
codefalling 2015-12-11 11:03:55 +08:00
parent 2a650d5de1
commit f23cbd9f73

View File

@ -1,7 +1,7 @@
if which percol &> /dev/null; then if which percol &> /dev/null; then
function percol_select_history() { function percol_select_history() {
local tac local tac
tac="tail -r" which gtac &> /dev/null && tac="gtac" || { which tac &> /dev/null && tac="tac" || { tac="tail -r" } }
BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER") BUFFER=$(fc -l -n 1 | eval $tac | percol --query "$LBUFFER")
CURSOR=$#BUFFER CURSOR=$#BUFFER
zle -R -c zle -R -c