fix hstr not available
This commit is contained in:
@@ -31,12 +31,14 @@ export HISTCONTROL=ignoreboth:erasedups # no duplicate entries
|
|||||||
export HISTFILESIZE=2500000
|
export HISTFILESIZE=2500000
|
||||||
export HISTSIZE=250000
|
export HISTSIZE=250000
|
||||||
|
|
||||||
|
if type hstr >/dev/null 2>&1; then
|
||||||
# ensure synchronization between bash memory and history file
|
# ensure synchronization between bash memory and history file
|
||||||
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
|
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}"
|
||||||
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi
|
if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hstr -- \C-j"'; fi
|
||||||
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k
|
# if this is interactive shell, then bind 'kill last command' to Ctrl-x k
|
||||||
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi
|
if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi
|
||||||
export HSTR_TIOCSTI=y
|
export HSTR_TIOCSTI=y
|
||||||
|
fi
|
||||||
|
|
||||||
# If not running interactively, don't do anything
|
# If not running interactively, don't do anything
|
||||||
case $- in
|
case $- in
|
||||||
|
|||||||
Reference in New Issue
Block a user