Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash: __vte_prompt_command: command not found

bash: __vte_prompt_command: command not found

Whenever I open a terminal, I am greeted with this line. Also, this is printed each time I enter a command in the terminal.

I am a linux-noob, and would be happy to read up, if someone can point me to some resource, or hint at a possible solution. I tried google-ing, but was unable to turn up with any useful results.

I did not do anything specific just before this started popping up.

Thanks in advance :)

Additional Info:

  • The terminal I used is the default gnome-terminal

  • Fedora 20

like image 854
pradeepcep Avatar asked Mar 09 '14 11:03

pradeepcep


3 Answers

It sounds like a program named VTE has set your bash environment variable PROMPT_COMMAND to invoke a function called __vte_prompt_command.

The PROMPT_COMMAND environment variable defines a command that is executed before every new prompt is displayed to the screen. It can be very annoying when this command produces unexpected output.

You can temporarily get rid of the annoying messages by entering this command in the terminal:

__vte_prompt_command() { true; }

This creates a dummy function that does nothing - you can confirm by looking at the output of this command:

type __vte_prompt_command

After applying the hack to my system I see this:

__vte_prompt_command is a function
__vte_prompt_command ()
{
    true
}

However, this is an indication that VTE may not be installed properly and/or may be broken. You might want to try to reinstall VTE, if possible. I would not recommend putting this permanently into your ~/.bashrc file.

like image 144
carl.anderson Avatar answered Nov 14 '22 03:11

carl.anderson


I am running Ubuntu 18.04 with the default gnome-terminal and ran into the same problem but wanted a definitive solution.

After trying the solutions suggested previously, I still had the message:
__vte_prompt_command: command not found
comming up after starting a new terminal and after each command terminated.

I searched for a file in for instance .bashrc, .profile that would be doing a source /etc/profile.d/vte-2.91.sh with no luck.
Than I remembered that a long time ago I added the following line in my ~/.bashrc:

export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"

in order to append command line histories to all opened terminals. I figured out that commenting it solved the problem.

#export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"

than
$ source ~/.bashrc

Thought I would share this for anyone having the same problem.

like image 21
Gabriel Cretin Avatar answered Nov 14 '22 04:11

Gabriel Cretin


You can disable the corresponding code by editing your ~/.bashrc by using sudo gedit ~/.bashrc, searching for the string "vte" with STRG+F and outcommenting the line with a #. On my system, the line looked like this, I guess an old installation of Ubuntu Budgie put it there:

if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END

And if it looks like this, the line in your terminal will not appear anymore:

#if [ $TILIX_ID ] || [ $VTE_VERSION ] ; then source /etc/profile.d/vte.sh; fi # Ubuntu Budgie END
like image 1
Moritz Avatar answered Nov 14 '22 05:11

Moritz