使用iTerm2时,每次打开它或打开新窗口时,输入字段和上面的“最后登录”字符串中都会自动出现一个1。在最后一个登录字符串中,当我第一次打开iTerm时,它出现在“最后一次登录”之前,但当我打开一个新窗口时,它在新行上显示为1%。
我使用了最新的iTerm (3.3.7),以及噢-my。在iTerm的首选项中,我没有任何定义为在会话开始时运行的命令。直到最后一次更新,我才能通过将prompt_context () { }添加到我的.zshrc文件中来防止可怕的"1“出现--但即使这样也不再有帮助了。尽管如此,如果我完全删除.zshrc文件,问题仍然存在。
下面是我当前的.zshrc文件(减去一堆自动生成的、注释掉的行):
ZSHING_PLUGINS=(
"https://gitlab.com/zakariaGatter/zshing"
)
# source zshing plugin
source $HOME/.zshing/zshing/zshing.zsh
# Path to your oh-my-zsh installation.
export ZSH="/Users/dc/.oh-my-zsh"
ZSH_THEME=powerlevel10k/powerlevel10k
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"POWERLEVEL9K_MODE='nerdfont-complete'
source ~/powerlevel9k/powerlevel9k.zsh-theme
# Which plugins would you like to load?
# Standard plugins can be found in ~/.oh-my-zsh/plugins/*
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git
git-flow-completion
zsh-syntax-highlighting
zsh-autosuggestions
)
source $ZSH/oh-my-zsh.sh
# User configuration
export EDITOR="/usr/local/bin/atom --wait"
source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE_COUN=4
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
POWERLEVEL9K_DISABLE_PROMPT=true
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="▶ "
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
alias ls='ls -G'
# redefine prompt_context for hiding user@hostname
prompt_context () { }
eval $(thefuck --alias)
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi下面是打开iTerm2时发生的事情的图像(我尝试将clear添加为命令,以便在会话开始时运行,以通过常规配置缓解问题,但它只是最终发送了1clear,这就是为什么自动完成显示了它所做的事情):https://i.gyazo.com/4c6cf3826a2da40d5a8fe225b7d030c7.png
下面是在现有会话中打开一个新的iTerm2窗口时所发生的事情:https://i.gyazo.com/06c3ce5727afe053e4f9ec2cd07c26f0.png
下面是我的配置文件的一般配置图--我最初只是将clear放在“发送文本在开始”选项中:https://i.gyazo.com/1c3d407686047ddf1fddd957b209bef4.png
提前感谢任何花时间帮忙的人!
发布于 2020-03-02 18:49:12
我不太清楚这是怎么回事,但是这个解决了它:
https://stackoverflow.com/questions/58751588
复制相似问题