I have a line in my .bashrc the following line:
bind '"e[A": history-search-backward'
that causes that when I write "abc" to command prompt and press up arrow, bash searches in history only for commands that start with "abc". All is fine until I run top (and maybe some other applications that I am not sure about, with top, I am sure) when this behaviour is reversed to normal search. However, when I run bind '"e[A": history-search-backward'
in terminal, nothing changes and I have to kill and restart the terminal to get the old behaviour back. Is there a way to reverse it (or prevent it from happening?) This happens in gnome-terminal and xterm in Unity and Gnome Shell. tty seems to be not affected.
My -bashrc on top of stok ubuntu .bashrc is this:
bind '"e[A": history-search-backward'
bind '"e[B": history-search-forward'
# that behaviour is for pageup and pagedown
bind '"e[5~": previous-history'
bind '"e[6~": next-history'
# show possibilities if tab ambigious
set show-all-if-ambiguous on
# ignore case when completing, lets see how it works
set completion-ignore-case on
shopt -s cdspell
HISTSIZE=10000
HISTCONTROL=ignoredups
HISTFILESIZE=10001
HISTTIMEFORMAT="%h/%d - %H:%M:%S "
shopt -s histappend
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"