[Top][All Lists]

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

Re: Bug in history using ctl-r

From: Chris F.A. Johnson
Subject: Re: Bug in history using ctl-r
Date: Sat, 1 Oct 2005 11:35:00 -0400 (EDT)

        [incorrect command found using ^r]

In user mode ($>):
        mount /cdrom
        ... (do some stuff)
        umount /cdrom
        ^r m

Instead of finding "mount /cdrom" it finds "umount /cdrom" and leaves the cursor blinking 
on the "m" of

    Which is exactly what it is supposed to do. By default, ^R is bound to:

       reverse-search-history (C-r)
              Search  backward  starting  at the current
              line and moving `up' through  the  history
              as  necessary.   This  is  an  incremental

    You sound as if you want:

              Search  backward  through  the history for
              the string of characters between the start
              of  the  current line and the point.  This
              is a non-incremental search.

    This is not bound to any key by default. I have it bound to
    shift+up-arrow by putting this in my ~/.inputrc file:

"\e[a": history-search-backward  ## shift+up-arrow

    You could then type "m" and press shift+up-arrow to get the line
    you want.

    Chris F.A. Johnson                     <http://cfaj.freeshell.org>
    Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress

reply via email to

[Prev in Thread] Current Thread [Next in Thread]