当启用hist_ignore_dups
in时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 # show command with history expansion to user before running it
setopt share_history # share command history data
Run Code Online (Sandbox Code Playgroud)
我怀疑这一点extended_history
并且hist_ignore_dups
存在冲突。
归档时间: |
|
查看次数: |
4577 次 |
最近记录: |