今天不知道做什么操作,只要运行命令就会出现bash: __vte_prompt_command: command not found的提示,根据网上的资料,找到了__vte_prompt_command的出处,即/etc/profile.d,其内容如下:
[ -n "$BASH_VERSION" -o -n "$ZSH_VERSION" ] || return 0
[[ $- == *i* ]] || return 0
[ "${VTE_VERSION:-0}" -ge 3405 ] || return 0
__vte_urlencode() (
LC_ALL=C
str="$1"
while [ -n "$str" ]; do
safe="${str%%[!a-zA-Z0-9/:_\.\-\!\'\(\)~]*}"
printf "%s" "$safe"
str="${str#"$safe"}"
if [ -n "$str" ]; then
printf "%%%02X" "'$str"
str="${str#?}"
fi
done
)
__vte_ps1() {
echo -n "(__vte_ps1 is obsolete)"
}
__vte_osc7 () {
printf "\033]7;file://%s%s\a" "${HOSTNAME:-}" "$(__vte_urlencode "${PWD}")"
}
__vte_prompt_command() {
local pwd='~'
[ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
printf "\033]0;%s@%s:%s\007%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
}
case "$TERM" in
xterm*|vte*)
[ -n "$BASH_VERSION" ] && PROMPT_COMMAND="__vte_prompt_command"
[ -n "$ZSH_VERSION" ] && precmd_functions+=(__vte_osc7)
;;
esac
true
记得没有修改这个文件,好像只修改了~/.bashrc这个参数,然后就出现了vte.sh__vte_prompt_command的提示。通过执行source /etc/profile.d/vte.sh即可解决上面的问题,也可把source /etc/profile.d/vte.sh 加入到 ~/.bashrc里面,再执行一下source ~/.bashrc就行了。