7 ms·
For anyone who needs to/prefers to use bash: > One nice feature for fish history is the ability to filter through the history based on what is typed into the s
by devnonymous 6y ago
For anyone who needs to/prefers to use bash:
> One nice feature for fish history is the ability to filter through the history based on what is typed into the shell.
Add this to your .inputrc
## arrow up
"\e[A":history-search-backward
## arrow down
"\e[B":history-search-forward
> Fish does not enter any command that begins with a space into its history file, essentially treating it like an incognito command.
Add "HISTCONTROL=ignorespace" to your .bashrc
> A new addition in fish 3.0 is the --private flag that can be used to start fish in private mode; it stops all subsequent commands from being logged in the history file.
run unset HISTFILE
- NegativeLatency 6y agoThe inputrc change is nice, but not quite the same as what fish does. If I type a part of a previous command in and then press the up arrow in fish it will only cycle through history records that contain that as a substring (which is really the killer part of the feature). (Yes I know you can do similar things in bash but you have to press other keys to put it in the history search mode)
- devnonymous 6y agoI agree, although otoh, the inputrc change is not specific to bash. It is useful for any cli that uses readline (mysql, python prompt, pgcli,...). Other useful inputrc settings I have in mine : # - when performing completion in the middle of a word, do not insert characters # from the completion that match characters after point in the word being # completed set skip-completed-text on # - displays possible completions using different colors according to file type. set colored-stats on # - show completed prefix in a different color set colored-completion-prefix on # - jump temporarily to matching open parenthesis set blink-matching-paren on set expand-tilde on set history-size -1 set history-preserve-point on