Running is therapy

a blog about running, cats, Linux and programming.
  • Home
  • Current Schedule
  • Personal Records
  • Upcoming Races

Ubuntu bug in reverse/forward search in bash?

Published by Nathan Powell on March 9, 2008 12:17 pm under computers

For a long time now I have been addicted to using C-r (control-r) to do a reverse search in the terminal. If you haven’t done this, do it, it’s a huge time saver. Just hit C-r and start typing something unique from the command you are trying to recall.

I have a big history file (that’s what she said) on purpose, and being able to search back through it is nice. However one thing always bugged me, and I never got around to solving it, until today.

I would hit C-r and start typing, and then I would hit C-r a few more times to get back to the command I was actually looking for, except I ALWAYS got overzealous and went right past it. So I would hit C-c and start over. Then I thought, I bet you can go forward. Like any good Gnu/Linux user I typed man bash in my terminal and then /reverse.

Sure enough,

reverse-search-history (C-r)
  Search backward starting at the current line and moving ‘up’ through the history as necessary.  This is an incremental search.
 
forward-search-history (C-s)
  Search forward starting at the current line and moving ‘down’ through the history as necessary.  This is an incremental search.

That should work then. I pop out of my man reader, and hit C-r ssh


  (reverse-i-search)`ssh': ssh nathanpowell.org

Whoops! I meant to only go back to the one BEFORE that entry :). So I hit C-s…nothing. So I went to the modern forward slash of information, google.

I found this bug. It appears that, for whatever reason, C-s gets trampled on by C-s (stop). If you apply the workaround suggested there, it does indeed start to work. So I pushd the following onto my .bashrc (bad bash joke, and ultimately untrue since I added it to the bottom of the file, not the top of the “stack” *sigh* *groan*)


  stty stop undef

I don’t use stop in the shell so this will suffice for now, but it’s an interesting bug. I installed xterm, multi-gnome-terminal, and konsole, and only konsole was unaffected by the bug. So it’s an environment thing somewhere that konsole is not reading.

Does everyone else see this?

No Comment

Comments are closed.

Posting your comment.

  • Search

  • Archives

    • October 2008 (4)
    • September 2008 (4)
    • August 2008 (10)
    • July 2008 (11)
    • June 2008 (14)
    • May 2008 (15)
    • April 2008 (10)
    • March 2008 (16)
    • February 2008 (17)
    • January 2008 (37)
    • December 2007 (21)
    • November 2007 (30)
    • October 2007 (29)
    • September 2007 (22)
    • August 2007 (30)
    • July 2007 (49)
    • June 2007 (32)
    • May 2007 (29)
    • April 2007 (38)
    • March 2007 (26)
    • February 2007 (25)
    • January 2007 (23)
    • December 2006 (10)
    • November 2006 (12)
    • October 2006 (9)
    • September 2006 (9)
    • August 2006 (5)
    • July 2006 (13)
    • June 2006 (9)
    • May 2006 (8)
    • April 2006 (11)
    • March 2006 (12)
    • February 2006 (12)
    • January 2006 (13)
    • December 2005 (15)
    • November 2005 (19)
    • October 2005 (8)
  • Categories

    • blather (63)
    • books (10)
    • computers (177)
    • cooking (1)
    • economics (3)
    • emacs (3)
    • football (1)
    • gaming (1)
    • hiking (5)
    • housekeeping (5)
    • lifehacking (7)
    • music (3)
    • paddling (2)
    • personal (1)
    • politics (21)
    • programming (70)
    • running (232)
    • smoking (40)
    • sysadmin (10)
    • tlc (10)
    • Uncategorized (1)
  • Pages

    • Current Schedule
    • Personal Records
    • Upcoming Races

Copyright © 2008 Running is therapy
WordPress Theme based on Light Theme