From b6246bbaab18ae788f527f903e1778e1bb00b5d7 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Fri, 9 Jul 2021 07:48:32 +0200 Subject: [PATCH] zshrc: no longer set histignorealldups The histignorealldups option provides a feature, that if a new command line being added to the history list duplicates an older one, the older command is removed from the list. Demonstration: | root@grml ~ # echo foo | foo | root@grml ~ # echo bar | bar | root@grml ~ # history -E 0 | 1 9.7.2021 07:48 exec zsh | 2 9.7.2021 07:48 echo foo | 3 9.7.2021 07:48 echo bar | root@grml ~ # echo foo | foo | root@grml ~ # history -E 0 | 1 9.7.2021 07:48 exec zsh | 3 9.7.2021 07:48 echo bar | 5 9.7.2021 07:48 echo foo This is certainly useful for several people, like in personal setups. But especially for system administration tasks it's quite essential, that the history shows "the full truth", and it's hard to reconstruct the order of commands that have been executed. Whoever wants to get the old behavior back, can enable `setopt histignorealldups` in their personal zshrc. Provide the according configuration snippet in /etc/skel/.zshrc instead, and update docs accordingly. Closes: grml/grml-etc-core#114 --- doc/grmlzshrc.t2t | 5 ----- etc/skel/.zshrc | 3 +++ etc/zsh/zshrc | 4 ---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index d6e6325..c44f2e0 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -547,11 +547,6 @@ duration (in seconds) to the history file. Whenever a command completion is attempted, make sure the entire command path is hashed first. This makes the first completion slower. -: **histignorealldups** -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. - : **histignorespace** Remove command lines from the history list when the first character on the line is a space, or when one of the expanded aliases contains a diff --git a/etc/skel/.zshrc b/etc/skel/.zshrc index 8695b4d..37642a3 100644 --- a/etc/skel/.zshrc +++ b/etc/skel/.zshrc @@ -122,6 +122,9 @@ fi ## Allow comments even in interactive shells #setopt interactivecomments +## if a new command line being added to the history list duplicates an older +## one, the older command is removed from the list +#is4 && setopt histignorealldups ## compsys related snippets ## diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 718853f..4ddd4f9 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -432,10 +432,6 @@ is4 && setopt share_history # save each command's beginning timestamp and the duration to the history file setopt extended_history -# If a new command line being added to the history list duplicates an older -# one, the older command is removed from the list -is4 && setopt histignorealldups - # remove command lines from the history list when the first character on the # line is a space setopt histignorespace -- 2.1.4