bash:__vte_prompt_command:找不到命令

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22281875/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 09:51:19  来源:igfitidea点击:

bash: __vte_prompt_command: command not found

linuxbashterminalfedoragnome-terminal

提问by pradeepcep

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.

我是一个 linux-noob,如果有人可以指出我的一些资源或暗示可能的解决方案,我很乐意阅读。我尝试了 google-ing,但无法找到任何有用的结果。

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

  • 我使用的终端是默认的 gnome-terminal

  • 软呢帽 20

回答by carl.anderson

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

听起来像是一个名为 VTE 的程序已将您的 bash 环境变量设置PROMPT_COMMAND为调用名为__vte_prompt_command.

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

PROMPT_COMMAND环境变量定义之前被显示到屏幕上的每个新的提示时执行的命令。当此命令产生意外输出时,可能会非常烦人。

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:

将 hack 应用到我的系统后,我看到了这个:

__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 notrecommend putting this permanently into your ~/.bashrcfile.

但是,这表明 VTE 可能未正确安装和/或可能已损坏。如果可能,您可能想尝试重新安装 VTE。我建议将其永久放入您的~/.bashrc文件中。

回答by Gabriel C

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

我正在使用默认的 gnome-terminal 运行 Ubuntu 18.04 并遇到同样的问题,但想要一个明确的解决方案。

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.

在尝试了之前建议的解决方案后,我仍然收到消息:
__vte_prompt_command: command not found
在启动新终端后和每个命令终止后出现。

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

例如.bashrc,我在 中搜索了一个文件,.profile这将是source /etc/profile.d/vte-2.91.sh没有运气的。
比我记得很久以前我在我的中添加了以下行~/.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


$ source ~/.bashrc

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

以为我会与任何有同样问题的人分享这个。

回答by Moritz Z.

You can disable the corresponding code by editing your ~/.bashrcby 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:

您可以~/.bashrc通过使用编辑您的代码,使用STRG+Fsudo gedit ~/.bashrc搜索字符串“vte”并使用#. 在我的系统上,该行看起来像这样,我猜 Ubuntu Budgie 的旧安装将它放在那里:

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

回答by Walk

For CentOS7 (64 bit):

对于 CentOS7(64 位):

Try installing using yumcommand.

尝试使用yum命令安装。

sudo yum update -y
sudo yum install -y terminator
sudo yum install -y epel-release
sudo yum install -y terminator #again

Resart the command prompt terminal, This worked for me (:

重新启动命令提示符终端,这对我有用(:

Reference: http://bytefreaks.net/gnulinux/install-terminator-in-centos-7-64bit

参考:http: //bytefreaks.net/gnulinux/install-terminator-in-centos-7-64bit