5 ms·
Control-R will work with anything that uses readline and keeps history. In addition to working in the Unix shell, it also works in psql (the PostgreSQL tool) a
by Mister_Snuggles 12y ago
Control-R will work with anything that uses readline and keeps history. In addition to working in the Unix shell, it also works in psql (the PostgreSQL tool) and the Python REPL.
It's a very useful trick to keep up your sleeve!
- encoderer 12y agoPython REPL? Is there something I need to do to enable that?
- Bootvis 12y agoType python in your shell?
- maxerickson 12y agoNote that a given python may be compiled without readline or with a readline replacement.
- encoderer 12y agoYeah, the one on OSX isn't compiled w/ readline. But I tried it on a ubuntu host and it works.
- Mister_Snuggles 12y agoThe Python REPL that I'm using has readline enabled. If you don't have it you may need to rebulid it and enable readline when you run configure.
- ninkendo 12y agoTip for rbenv users on OSX... install readline with homebrew and install your ruby versions with: SKIP_PRECOMPILED_RUBIES=1 CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)" rbenv install (version) to get readline working for irb/pry (for ctrl+r search, etc.)
- protopete 12y agoYou can also use "rlwrap" with any program to enable readline features.