7

I am new to Linux. I use Ubuntu 11.04. Whenever I open a file with kate from the commandline, with 'kate &' (or without ampersand), Kate starts out giving messages on the console. It continuously gives them out as I save a file or close one. They look like debug messages to me (sample below). I have used Synaptic package manager to install Kate. Uninstalling and installing the dev version did not make any change. Soon my console becomes cluttered. Is there a way to suppress these messages? There was nothing explicit in Kate settings either.

Thank you,

The messages look like

kate(13412)/kate-filetree KateFileTreeModel::handleInsert: BEGIN!
kate(13412)/kate-filetree KateFileTreeModel::handleInsert: creating a new root
kate(13412)/kate-filetree ProxyItem::ProxyItem: ProxyItem(0x1796840,0x0,-1,QObject(0x0)
....
kate(13435)/kate-filetree KateFileTreeModel::documentActivated: adding viewHistory ProxyItem(0x1eb7cf0,0x1eb6830,0,KateDocument(0x1d93ea0) , "Untitled" )
kate(13435)/kate-filetree KateFileTreeModel::updateBackgrounds: BEGIN!
kate(13435)/kate-filetree KateFileTreeModel::updateBackgrounds: END!
kate(13435)/kate-filetree KateFileTreeModel::documentActivated: END!
kate(13435)/kate-filetree KateFileTreePluginView::viewChanged: END!
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5601b42
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x5601b42
1
  • This does not happen in any of the other applications.
    – Elan
    Mar 29, 2012 at 12:12

3 Answers 3

12

This post on the KDE forum explains what it is doing and how to stop it.

http://forum.kde.org/viewtopic.php?f=22&t=93955

Because you did not disable debug-messages.

Open "kdebugdialog", search for "kate" and unselect all checkboxes. Now kate won't talk to you, anymore.

3
  • +1 after including the crucial bit of the linked page
    – sehe
    Mar 30, 2012 at 13:32
  • This worked, but there were some dependencies, as on kdeui. The dependencies still give out debug messages. Some of them were not clear, where they come from, and I am reluctant to blanket remove all notifications from all applications.
    – Elan
    Mar 30, 2012 at 14:31
  • 1
    This does not work for me. Still gives debug output even though ALL debug information is turned off.
    – SO Stinks
    May 9, 2020 at 1:32
1

Debug messages are usually written to the standard error, which is the filehandle denoted by 2 in the console. You can redirect that without affecting output to the standard out (file handle 1), by starting your application like this

kate 2>/dev/null

You can append the & if you'd like as well.

The number 2 here represents file handle 2, the > is a redirection operator in the shell, /dev/null is a "blackhole" device -- it eats up everything that is written to it, so it "disappears" (does not appear in console).

You can capture the standard error output by replacing /dev/null with a filename. In that case the output goes to the file, not to the console.

In case the application is writing debug messages to the standard output, you can replace the number 2 with number 1 (see above) -- note that in this case normal messages are going to be redirected as well.

You can redirect both standard out and error at the same time, the easiest way to do so is

kate 2>&1 1>/dev/null

Here the &1 denotes the file handle 1 where standard error should be redirected. The use of & is to differentiate it from the file named 1.

For further info on redirection, read the manual of your shell (e.g. bash)

1
  • I am using csh. From your description, I followed documentation to achieve redirecting both stderr and stdout to /dev/null. Apparently, redirecting only sdterr is not that trivial. Thanks for the generic explanation of the concept.
    – Elan
    Mar 30, 2012 at 9:20
0

Turning off all the debug stil gave me some context errors - which is annoying. So I resorted to another trick (partially explained by Attila:

Move the kate executable and replace it with a script:

cd /usr/bin
sudo mv kate kate_exec
sudo touch kate
sudo chmod 755 kate
sudo vim kate

The in vim (or what ever editor) change kate (now a script) to

kate_exec $@ 2> /dev/null &

You don't need the & at the end, that's just my preference so I can keep typing in my terminal - Attila goes on to explain most of that stuff. The key here is passing all parameters on to the kate execuatable $@ and the redirection of the stderr 2> /dev/null.

2
  • 1
    For most people, it's probably much better to solve an issue like this through an alias at the user-level.
    – SO Stinks
    Oct 12, 2019 at 3:28
  • @Dr.PersonPersonII hmm.... maybe so, but that does not quite cover all cases because your alias will need to be something other then the kate command. So if you run kate from its launcher or from the app menu it might still have these little issues. But, your point is very valid and, as you say, may be better/easier/safer for most users : ) Oct 12, 2019 at 5:51

You must log in to answer this question.

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