从命令行运行应用程序时隐藏调试信息

tut*_*uca 4 gedit command-line

大多数时间gtk从命令行运行应用程序,它开始将调试信息转储到stdout即使我将它们置于后台。

例子:

~$ gedit test.html # and ctrl+z to suspend
zsh: suspended  gedit .zshrc
~$ bg
[1]  + continued  gedit .zshrc
~$
# do some editing
(gedit:6208): GtkSourceView-WARNING **: Could not find word to remove in buffer (whoosh), this should not happen!

(gedit:6208): GtkSourceView-WARNING **: Could not find word to remove in buffer (haystack), this should not happen!
Run Code Online (Sandbox Code Playgroud)

我想指出错误或警告会根据我目前正在做的事情而变化。这里GtkSourceView-WARNING显示的是其中一种情况。

无论如何......你知道是否有可能避免打印出这些信息?

isu*_*dor 8

您可以将这些标准输出和错误消息发送到空设备,以便它们不会出现在您的终端中,例如gedit test.html >/dev/null 2>&1