如果我键入多行命令,并运行它,一切正常。 当我按下向上箭头,并要删除一些字符,我看到删除发生。如果我运行修改后的命令,我可以看到删除全部错误。zsh多行命令错误:删除字符混淆
通常它会删除/插入在一个方向上移动一个位置的字符。
例子:
$ sort file | uniq | grep -v 'some pattern' |less
我想删除单词file
与other_file
更换。这是我看到
$ sort other_file | uniq | grep -v 'pattern' |less
这是将实际运行
$ sort fother_file | uniq | grep -v 'pattern' |less
公告名称为 'fother_file'。这真的很烦人,并且使修改历史基本上不可能。我最终将代码复制粘贴到zsh中。
这是我的〜/ .zshrc文件
HISTFILE=~/.zshhistfile
HISTSIZE=40000
SAVEHIST=1000
bindkey -v
zstyle :compinstall filename '/home/shefuto/.zshrc'
autoload -Uz compinit
compinit
if [ -f ~/.aliases ]; then
. ~/.aliases
fi
export PS1="%{%F{yellow}%}%T]%{%F{green}%}%n%{%F{yellow}%} %~ %{$%f%} "
export WORKON_HOME=~/ve
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
workon tmp2
if [[ -e /etc/bash_completion.d/git-prompt ]]; then
. /etc/bash_completion.d/git-prompt
fi
setopt PROMPT_SUBST ;
export RPROMPT='%{%F{red}%}$(__git_ps1 2>/dev/null)'
bindkey "^?" backward-delete-char
bindkey -e
有谁知道如何解决这一问题?
'%{...%}''''''''''''''''zsh'转义序列不应该是必需的。 'zsh'已经知道它不会前进光标。我也考虑使用'zsh'的版本控制提示状态,而不是尝试使用'bash_completion'。 – chepner