Trying to get a spec implemented
If people could review, make comments etc, or help me out implementing this that would be great. Basically, this is the default behavior of page up and page down in suse, and it works great. For example:
At the command line I type “ssh” then hit page up and it will come up with “ssh sharms@sharms.org”. Hitting page up again will come up with “ssh sharms@test.com”. It takes a partial command from the command line, and matches it with history entries. This is awesome with respect to saving time typing.
This is also a great opportunity to try and get other features into bash that make it easier to use (there is a good comment on the spec with more useful changes).
https://wiki.ubuntu.com/Spec/EnhancedBash
Update: Test run
If you wonder what the heck I am talking about, follow these steps:
- Edit file “.inputrc” in your home directory
- Paste the following lines:
- Open up a new shell
- Type “history”
- Find a command that you have recently used
- Now type part of that command (ex ss) then hit page up and it will come up with the most recent match
- Keep hitting page-up for more matches, or hit page down to go back to the last match
- Advocate getting this spec implemented!
"\e[5~": history-search-backward
"\e[6~": history-search-forward
Related posts:
#1 by Stoffe on April 6, 2007 - 1:37 pm
Quote
It’s probably pretty easy to research this, but I think it would be useful to have an example on how to implement this (locally) to try it out on the wiki page, something that could just be pasted into .bash_profile.
It sounds like a great idea, and so does the extra ideas in the comment section.
#2 by Johnny Chadda on April 6, 2007 - 3:37 pm
Quote
A very handy feature indeed, but maybe ctrl-r is good enough for most people.
#3 by firephoto on April 6, 2007 - 4:14 pm
Quote
/etc/inputrc
# alternate mappings for “page up” and “page down” to search the history
# “\e[5~”: history-search-backward
# “\e[6~”: history-search-forward
It’s commented out by default (obviously) and also the other mapping for page up/down.
#4 by Porges on April 6, 2007 - 4:20 pm
Quote
I prefer plain old ‘up’ and ‘down’:
"\e[A": history-search-backward"\e[B": history-search-forward
Also, I set my bash history to eliminate duplicates.
#5 by Styles #ubuntu-offtopic on April 6, 2007 - 7:49 pm
Quote
You should try out “fish” it does that and more i.e. real time syntax highlighting on the command line. it’s in the repos.
just
apt-get install fish
add the bellow line to the end of your .bashrc file
if [ $SHELL == /bin/bash ]; then fish; fi
#6 by Trevor on April 7, 2007 - 10:50 am
Quote
That’s brilliant! Definitely something which will make the shell even faster for me to use. I think it should definitely be enabled by default.
Pingback: Alexandre Vassalotti » Welcome to Mr. Crystal Ball
Pingback: Ubuntu | Alexandre Vassalotti: Welcome to Mr. Crystal Ball