For example, say I do a command like appbuild by hitting up arrow ten times in a row. Now, if I want to go back to the last unique command before that, I have to hit up ten times in a row.

Any way to change this preference? IIRC Bash did not do this.


I think you're looking for setopt hist_ignore_dups. The equivalent bash setting was HISTCONTROL=ignoredups:…. If you had HISTCONTROL=erasedups, the zsh equivalent is setopt hist_ignore_all_dups.

On a related note, the zsh equivalent to putting ignorespace in HISTCONTROL is setopt hist_ignore_space.

setopt commands, like other interactive configurations for zsh, go into ~/.zshrc (i.e. the file called .zshrc in your home directory).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.