小编cur*_*oky的帖子

如何使用 hist_ignore_dups 忽略 zsh 中启用 Extended_history 的重复行?

当启用hist_ignore_dupsin时zsh,我发现 中有很多重复的行$HISTFILE

(笔记:HISTFILE="$HOME/.zsh_history"

$ cat $HISTFILE

: 1593874281:0;ls
: 1593874287:0;l
: 1593874288:0;ls
: 1593874291:0;l
Run Code Online (Sandbox Code Playgroud)

我认为hist_ignore_dups应该解决这个问题。(HIST_IGNORE_DUPS http://zsh.sourceforge.net/Doc/Release/Options.html)。

但是重复的行仍然出现在 中$HISTFILE,即使已经通过历史记录hist_ignore_dups插件启用了。ohmyzsh

## History command configuration
setopt extended_history       # record timestamp of command in HISTFILE
setopt hist_expire_dups_first # delete duplicates first when HISTFILE size exceeds HISTSIZE
setopt hist_ignore_dups       # ignore duplicated commands history list
setopt hist_ignore_space      # ignore commands that start with space
setopt hist_verify            # …
Run Code Online (Sandbox Code Playgroud)

zsh

8
推荐指数
1
解决办法
4577
查看次数

标签 统计

zsh ×1