在小于全屏的终端窗口中,如果我输入一个长命令,它会开始覆盖我所在的当前行。如果我输入一个额外的行,它最终会移动到下一行。有谁知道如何解决这一问题?
这是视觉上发生的事情:
编辑:这些是我的提示设置:
PS1='\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\u@\h:\w\033[1m`__git_ps1`\033[0m\$ '
TERM=xterm
Run Code Online (Sandbox Code Playgroud)
.bashrc
:
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\033[1m`__git_ps1`\033[0m\$ '
fi
# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
Run Code Online (Sandbox Code Playgroud)
Jul*_*ght 11
由于某种原因,终端大小错误报告。当您调整终端大小时,它应该会发生变化。
在你的 .bashrc 命令文件中试试这个:
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
Run Code Online (Sandbox Code Playgroud)