Re:Show HN: HiSHtory: Your shell history in context, synced,...
by Cockbrand on Wednesday November 02, 2022 @09:14AM
(#33435184)
While ignoring commands preceded by a space character is absolutely one of my very favorite shell features, it usually isn't enabled by default (YMMV).
HISTCONTROL=ignorespace # bash
setopt hist_ignore_space # zsh
These go into ~/.bashrc or ~/.zshrc, respectively. zsh is really smart about this and always enables you to retrieve the immediate previous line with arrow-up, no matter whether it's got preceding whitespace or not.
HISTCONTROL=ignorespace # bash
setopt hist_ignore_space # zsh
These go into ~/.bashrc or ~/.zshrc, respectively. zsh is really smart about this and always enables you to retrieve the immediate previous line with arrow-up, no matter whether it's got preceding whitespace or not.