재현 단계:
- zsh를 기본 쉘로 만듭니다.
- 새 터미널을 엽니다. 예를 들어 Ctrl++ 를 사용합니다 Alt.T
- Ctrl+ Shift+를 눌러 T새 터미널 탭을 엽니다.
^T%
첫 번째 줄로 표시됨
나는 lxde와 zsh-4.3.11을 사용하여 우분투 11.10을 실행하고 있습니다.
Gnome 터미널에는 이 문제가 없습니다.
콘텐츠 /etc/zsh/zshrc
:
# /etc/zsh/zshrc: system-wide .zshrc file for zsh(1).
#
# This file is sourced only for interactive shells. It
# should contain commands to set up aliases, functions,
# options, key bindings, etc.
#
# Global Order: zshenv, zprofile, zshrc, zlogin
READNULLCMD=${PAGER:-/usr/bin/pager}
if [[ "$TERM" != emacs ]]; then
[[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
[[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
[[ -z "$terminfo[kend]" ]] || bindkey -M emacs "$terminfo[kend]" end-of-line
[[ -z "$terminfo[kich1]" ]] || bindkey -M emacs "$terminfo[kich1]" overwrite-mode
[[ -z "$terminfo[kdch1]" ]] || bindkey -M vicmd "$terminfo[kdch1]" vi-delete-char
[[ -z "$terminfo[khome]" ]] || bindkey -M vicmd "$terminfo[khome]" vi-beginning-of-line
[[ -z "$terminfo[kend]" ]] || bindkey -M vicmd "$terminfo[kend]" vi-end-of-line
[[ -z "$terminfo[kich1]" ]] || bindkey -M vicmd "$terminfo[kich1]" overwrite-mode
[[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" vi-up-line-or-history
[[ -z "$terminfo[cuf1]" ]] || bindkey -M viins "$terminfo[cuf1]" vi-forward-char
[[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
[[ -z "$terminfo[kcud1]" ]] || bindkey -M viins "$terminfo[kcud1]" vi-down-line-or-history
[[ -z "$terminfo[kcuf1]" ]] || bindkey -M viins "$terminfo[kcuf1]" vi-forward-char
[[ -z "$terminfo[kcub1]" ]] || bindkey -M viins "$terminfo[kcub1]" vi-backward-char
# ncurses fogyatekos
[[ "$terminfo[kcuu1]" == ""* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" vi-up-line-or-history
[[ "$terminfo[kcud1]" == ""* ]] && bindkey -M viins "${terminfo[kcud1]/O/[}" vi-down-line-or-history
[[ "$terminfo[kcuf1]" == ""* ]] && bindkey -M viins "${terminfo[kcuf1]/O/[}" vi-forward-char
[[ "$terminfo[kcub1]" == ""* ]] && bindkey -M viins "${terminfo[kcub1]/O/[}" vi-backward-char
[[ "$terminfo[khome]" == ""* ]] && bindkey -M viins "${terminfo[khome]/O/[}" beginning-of-line
[[ "$terminfo[kend]" == ""* ]] && bindkey -M viins "${terminfo[kend]/O/[}" end-of-line
[[ "$terminfo[khome]" == ""* ]] && bindkey -M emacs "${terminfo[khome]/O/[}" beginning-of-line
[[ "$terminfo[kend]" == ""* ]] && bindkey -M emacs "${terminfo[kend]/O/[}" end-of-line
fi
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin /usr/local/bin \
/usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin
unalias run-help
autoload run-help
# If you don't want compinit called here, place the line
# skip_global_compinit=1
# in your $ZDOTDIR/.zshenv or $ZDOTDIR/.zprofice
if [[ -z "$skip_global_compinit" ]]; then
autoload -U compinit
compinit
fi
콘텐츠 ~/.zshrc
:
# The following lines were added by compinstall
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
zstyle ':completion:*' group-name ''
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' matcher-list '' 'm:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' 'r:|[._-]=* r:|=*' '+l:|=* r:|=*'
zstyle :compinstall filename '/home/kirill/.zshrc'
autoload -Uz compinit promptinit zcalc zsh-mime-setup
compinit
promptinit
zsh-mime-setup
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory autocd extendedglob notify sharehistory
setopt HIST_EXPIRE_DUPS_FIRST
#{{{ Shell Conveniences
# some more ls aliases
alias ls='ls --color'
alias lt='ls --color -ltr'
alias ll='ls -l'
alias lh='ls -l -h'
alias la='ls -A'
alias l='ls -CF'
alias vir='vim -R'
alias vimnw='vim -R +"set nowrap"'
alias tok='top -n1 -b -u kirill'
alias gt='gnome-terminal'
alias gts='gnome-terminal --window-with-profile=shnurov'
#alias tv='/usr/toolworks/totalview.8.6.2-2/bin/totalview'
#alias mpic='mpiCC.openmpi -o main -I/usr/local/include/boost-1_39/ main.cc -Llibdir -lboost_mpi-gcc43-mt-1_39 -lboost_serialization-gcc43-mt-1_39'
#alias mpir='mpirun.openmpi -np 7 ./main'
alias sage='~/progs/sage-4.8/sage'
#alias gmolden='/home/kirill/progs/molden/gmolden'
#alias molden='/home/kirill/progs/molden/molden'
#export LD_LIBRARY_PATH=/home/kirill/progs/molekel_5_4_0_linux_x86_64/lib:$LD_LIBRARY_PATH
#alias molekel='/home/kirill/progs/molekel_5_4_0_linux_x86_64/bin/Molekel'
#alias molekel='source /home/kirill/progs/molekel_5_4_0_linux_x86_64/launch_molekel.sh'
alias duh='du -s -h'
alias mam='make; time ./main'
alias mac='make clean;make;time ./main'
alias atdtool='~/progs/atdtool/atdtool'
alias acro='acroread -openInNewWindow'
#}}}
bindkey -e
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
# End of lines configured by zsh-newuser-install
# Customize to your needs...
export PATH=/opt/intel/composer_xe_2011_sp1.6.233/bin/intel64:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/intel/composer_xe_2011_sp1.6.233/mpirt/bin/intel64
#source /opt/intel/bin/compilervars.sh intel64
autoload -U colors && colors
PROMPT="%{$fg[red]%}%*%{$reset_color%}.%{$fg[cyan]%}%~%{$reset_color%}
%{$reset_color%}%{$fg[magenta]%}>%{$reset_color%}"
#PROMPT="${fg_red}%*${fg_white}${at_normal}.${fg_cyan}%~${fg_white} ${bg_grey}
#${at_normal}${fg_white}>${at_normal}"
답변1
lxterminal 오류입니다.
zsh는 프롬프트를 실행하기 전에 후행 줄 바꿈을 포함하지 않으면 이전 명령으로 표시된 숨겨진 문자를 표시하려고 시도할 수 있을 만큼 충분히 우수하기 때문에 다른 셸에는 표시되지 않습니다.
을 입력하면 echo -n foo
이 표시됩니다 foo%
. 개행 문자가 없음을 나타냅니다 %
. 위에서 일어나는 일은 ^T
쉘을 실행하기 전에 lxterminal이 이것을 출력한다는 것입니다.
^T%\nprompt>
다른 쉘에서는 보이는 것과 다릅니다 ^Tprompt
.
그런데 Lxterminal에는 또 다른 버그가 있는데, $SHELL
.