diff --git a/linux/.bashrc b/linux/.bashrc index b58bf98..6744b8b 100755 --- a/linux/.bashrc +++ b/linux/.bashrc @@ -31,12 +31,14 @@ export HISTCONTROL=ignoreboth:erasedups # no duplicate entries export HISTFILESIZE=2500000 export HISTSIZE=250000 -# ensure synchronization between bash memory and history file -export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" -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 [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi -export HSTR_TIOCSTI=y +if type hstr >/dev/null 2>&1; then + # ensure synchronization between bash memory and history file + export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" + 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 [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hstr -k \C-j"'; fi + export HSTR_TIOCSTI=y +fi # If not running interactively, don't do anything case $- in