[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re: bash history search key binding

    Hi all,

    I am using debian testing, and the bash version is 3.1.5.
    I have the following lines in my .bashrc to assign arrow keys to
    history search:

bind '"\M-[A":history-search-backward'
bind '"\M-[B":history-search-forward'

what does

$ bind -P | grep history


    It worked well before, one day, after I did a routine upgrade,

what do you mean by this? did you upgrade your system as part of your weekly/monthly routine.. or did you upgrade something in particular? Were.. bash.. the readline library upgraded as part of the process?

    it stopped working. The weird thing is, the arrow key search
    still works in a sudo shell.

how do you start this "sudo shell"..? does it run under the same user as the "other" shell..?

    Anyone has a clue on what's wrong?

the more likely cause is that the arrow keys are no longer bound when running in the "regular shell" context.. and do get bound in the "sudo shell" .. that's why I suggest checking the output of the bind command..

just a thougt but the up arrow is normally bound by default to "previous-history" - at least that's how it is in the version of bash I am running (2.05) .. what happens when you run your "regular shell" and you hit up-arrow.. do you get the default behavior .. or nothing happens..?

Thanks for your advice, but misteriously, it is back to normal now.
I swear to god I didn't do anything, oh, wait, maybe I did an aptitude upgrade
without even knowing about it.

BTW, I wasn't talking about the default bash key binding.
I don't know the official name, it works like this:
enter a word, say "cd" in a bash shell, then press
up and down key will walk you through all previous commands
that start with "cd" one by one. This is more efficient
than the default behavior of up/down key binding, which
shows you the whole command history one by one.


Reply to: