Everytime I open a command terminal or press enter the above error message show up.Does no harm but very annoying.

~/.bash_profile is here

# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
# User specific environment and startup programs

This is the area that cause the error in /etc/bashrc

  if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
  elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then
      PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

If I add this line to ~/.bashrc the problem fixed

source /etc/profile.d/vte.sh

Apparantly _vte_prompt_comand only defined in vte.sh

__vte_prompt_command() {
  local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//')
  command="${command//;/ }"
  local pwd='~'
  [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
  printf "\033]777;notify;Command completed;%s\007\033]0;%s@%s:%s\007%s" "${command}" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"

What this command actually do?Arent these /etc/profile.d/*.sh loaded at startup?Can someone explain why it is behaving this way?

  • I just ran into this using x2go to connect into a centos 7 vm running xfce. It's very unclear how this could break. Your work around works, but only for the current terminal window. The /etc/profile.d/*.sh should be loaded at startup. very weird.
    – poleguy
    Commented Mar 2, 2021 at 15:37

1 Answer 1


From the gnome-terminal 3.7.0 changelog:

To make new tabs opened within Terminal have the same same working directory as the current tab, it is necessary for the shell running in the terminal to cooperate. For this, vte installs a bash shell script that you must use in your bash PS1 prompt. (...)

I read that from https://bugzilla.redhat.com/show_bug.cgi?id=924275 when searching for the same question

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .