如何消除每个新窗口出现在iterm2输入字段中的未分配“ 1”?

使用iTerm2时,每次我打开或打开新窗口时,1都会自动出现在输入字段和上方的“最后登录”字符串中。在最后一个登录字符串中,当我第一次打开iTerm时,它出现在“上次登录”之前,但是当我打开新窗口时,它在新行上显示为1%

我使用最新的iTerm(3.3.7),以及oh-my-zsh。在iTerm的首选项中,我没有任何定义为要在会话开始时运行的命令的内容。在最后一次更新之前,我可以通过向我的.zshrc文件中添加prompt_context () { }来防止出现可怕的“ 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添加为在会话开始时运行的命令,以通过常规配置缓解此问题,但最终只是发送{{ 1}},所以这就是自动完成显示其作用的原因): https://i.gyazo.com/4c6cf3826a2da40d5a8fe225b7d030c7.png

以下是当我从现有会话中打开新的iTerm2窗口时发生的图像:https://i.gyazo.com/06c3ce5727afe053e4f9ec2cd07c26f0.png

这是我的个人资料常规配置的图片-我最初只是将1clear放在“在开始时发送文本”选项中: https://i.gyazo.com/1c3d407686047ddf1fddd957b209bef4.png

在此先感谢所有花时间帮助您的人!

jasonlevon 回答:如何消除每个新窗口出现在iterm2输入字段中的未分配“ 1”?

我不太确定为什么这样做,但已解决:

  1. 转到iTerm2>“首选项”>“配置文件”>“窗口”
  2. 在“新窗口的设置”部分下,将“空间”设置从下拉列表更改为“当前空间”
本文链接:https://www.f2er.com/3143751.html

大家都在问