zsh: Add zsh.history.ignoreAllDups config option (#4248)

This commit is contained in:
Lena Fuhrimann 2023-08-04 12:12:57 +02:00 committed by GitHub
parent a4f4508791
commit 15043a6591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,16 @@ let
'';
};
ignoreAllDups = mkOption {
type = types.bool;
default = false;
description = ''
If a new command line being added to the history list
duplicates an older one, the older command is removed
from the list (even if it is not the previous event).
'';
};
ignoreSpace = mkOption {
type = types.bool;
default = true;
@ -588,6 +598,7 @@ in
setopt HIST_FCNTL_LOCK
${if cfg.history.ignoreDups then "setopt" else "unsetopt"} HIST_IGNORE_DUPS
${if cfg.history.ignoreAllDups then "setopt" else "unsetopt"} HIST_IGNORE_ALL_DUPS
${if cfg.history.ignoreSpace then "setopt" else "unsetopt"} HIST_IGNORE_SPACE
${if cfg.history.expireDuplicatesFirst then "setopt" else "unsetopt"} HIST_EXPIRE_DUPS_FIRST
${if cfg.history.share then "setopt" else "unsetopt"} SHARE_HISTORY