Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mh0w/dacdafa517778a3fbe9fcd96202bebed to your computer and use it in GitHub Desktop.

Select an option

Save mh0w/dacdafa517778a3fbe9fcd96202bebed to your computer and use it in GitHub Desktop.
Enable matching history navigation in bash terminal (type one or more characters and then hit up/down)
# Enable matching history navigation in bash terminals
# May need to pip install gnureadline first
# Press up-arrow for previous matching command
# Two bindings as different terminals use different escape chars
bind '"\e[A": history-search-backward'
bind '"\eOA": history-search-backward'
# Press down-arrow for next matching command
# Two bindings as different terminals use different escape chars
bind '"\e[B": history-search-forward'
bind '"\eOB": history-search-forward'
# Retain a long history of commands
export HISTSIZE=1000000
export HISTFILESIZE=1000000000
# SEO terms: up, down, left, right, arrow, keys, navigation, history, search, bash, terminal, cmd, prompt, readline, gnu, gnureadline
@mh0w
Copy link
Author

mh0w commented May 2, 2025

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment