shi*_*ish 3 command-history zsh debian
这是我的 ~/.zsh/.zshrc -
/home/shirish/.zsh> cat .zshrc
# Lines configured by zsh-newuser-install
HISTFILE=~/.zsh//.histfile
HISTSIZE=10000
SAVEHIST=100000
setopt inc_append_history autocd nomatch notify share_history
bindkey -e
# End of lines configured by zsh-newuser-install
# display how long all tasks over 10 seconds take
export REPORTTIME=10
# The following lines were added by compinstall
zstyle :compinstall filename '/home/shirish/.zsh//.zshrc'
autoload -Uz compinit promptinit
compinit
promptinit
# End of lines added by compinstall
#from https://unix.stackexchange.com/questions/332732/removing-strange-characters-from-a-zsh-prompt
export LC_ALL=en_IN.UTF-8
export LANG=en_IN.UTF-8
export LANGUAGE=en_IN.UTF-8
#from https://unix.stackexchange.com/questions/332888/how-to-have-a-longer-xterm-title-in-zsh
autoload -Uz add-zsh-hook
function xterm_title_precmd () {
print -Pn '\e]2;%n@%m %1~\a'
}
function xterm_title_preexec () {
print -Pn '\e]2;%n@%m %~ %# '
print -n "${(q)1}\a"
}
if [[ "$TERM" == (screen*|xterm*|rxvt*) ]]; then
add-zsh-hook -Uz precmd xterm_title_precmd
add-zsh-hook -Uz preexec xterm_title_preexec
fi
prompt bigfade
Run Code Online (Sandbox Code Playgroud)
现在,如果我尝试获取历史输出,我只会从 .zsh 中获得 16 个历史条目。如果我想查看所有条目怎么办。出于某种原因,它只保存/显示了 16 个,其余的似乎没有被记录,我确实有同一个 shell 的多个选项卡。我不知道这是一个错误还是我需要添加的其他内容。
来自man fc:
如果 first 和 last 都省略,则应列出前 16 个命令或编辑前一个命令(基于 ?l 选项)。
要解决您的问题: alias history='fc -l -100'