首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我如何摆脱一个未分配的"1“,该”1“出现在迭代2的输入字段与每个新窗口?

我如何摆脱一个未分配的"1“,该”1“出现在迭代2的输入字段与每个新窗口?
EN

Stack Overflow用户
提问于 2019-11-07 15:05:44
回答 1查看 124关注 0票数 0

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

我使用了最新的iTerm (3.3.7),以及噢-my。在iTerm的首选项中,我没有任何定义为在会话开始时运行的命令。直到最后一次更新,我才能通过将prompt_context () { }添加到我的.zshrc文件中来防止可怕的"1“出现--但即使这样也不再有帮助了。尽管如此,如果我完全删除.zshrc文件,问题仍然存在。

下面是我当前的.zshrc文件(减去一堆自动生成的、注释掉的行):

代码语言:javascript
复制
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

提前感谢任何花时间帮忙的人!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-03-02 18:49:12

我不太清楚这是怎么回事,但是这个解决了它:

  1. 转到iTerm2 > Preferences > Profiles >Window
  2. “设置新窗口”部分,将“空格”设置从下拉到“当前空间”
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58751588

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档