In Bash MinGW on Windows 7, I would like to use Ctrl+O to perform a history search backward. However, I can't get this work -- i.e., this line in my ~/.inputrc does nothing (although it does work on a unix system I have access to):

"\C-o": history-search-backward

Using the Up key is ok, i.e. this works:

"\e[A": history-search-backward

I know that the terminal application (Console2) is not capturing the Ctrl+O, since I can map Ctrl+O to various things in terminal vim (launched from MinGW bash in Console2).

Anyone know why Ctrl-O is being ignored in Bash MinGW?

  • 2
    I'll bet Ctrl-S and Ctrl-Q don't work either. Most likely that these characters are being used for flow control. When vim runs, it turns this off, but bash does not. If you were running on Unix, you'd be able to use stty to disable this, but I haven't figured out how to disable this in Windows. BTW there doesn't seem to be a problem with Ctrl-P. – jdigital Feb 27 '14 at 3:05
  • Thanks, that sounds right. I found this answer on the Apple site where you can use stty discard undef to make Ctrl+O work in mac terminal, but it doesn't work on Windows. (apple.stackexchange.com/questions/3253/…). And you were right about Ctrl-P working, so I edited the question title. And sorry I can't vote up your comment, insufficient rep. – mjeppesen Feb 27 '14 at 4:13

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.