在 vagrant ssh 中,使用 bash shell,使用“clear”命令会清除屏幕,然后在第一行出现两个提示,其中只有一个是预期或想要的。操作上并不重要,只是视觉上令人讨厌。什么/在哪里控制这种行为?
[vagrant@aws-terraform ~]$ [vagrant@aws-terraform ~]$
PS1 is [\u@\h \W]\$
SHELL is /bin/bash
Operating System: AlmaLinux 8.5 (Arctic Sphynx)
Kernel: Linux 4.18.0-348.20.1.el8_5.x86_64
根据请求编辑:
[vagrant@aws-terraform ~]$ type -a clear
clear is /usr/bin/clear
[vagrant@aws-terraform ~]$ echo "$PROMPT_COMMAND"
printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"
'reset' command does not have the same quirk. It results in a single prompt.