Bug 139025

Summary: kwrited outputs debugging info on stdout which prevents getting output from other apps
Product: [Applications] konsole Reporter: Krzysztof Lichota <krzysiek>
Component: kwritedAssignee: Robert Knight <robertknight>
Severity: normal CC: mail
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Updated binaries for kwrited which fix this bug.

Description Krzysztof Lichota 2006-12-19 21:26:17 UTC
Version:            (using KDE KDE 3.5.4)
Installed from:    Ubuntu Packages

KWrited uses puts() to output debugging information what device it is listening on. See http://lxr.kde.org/source/KDE/kdebase/konsole/konsole/kwrited.cpp?v=3.5-branch#080:
QString txt = i18n("KWrited - Listening on Device %1").arg(pty->ttyName());

As KWrited is a KDED module, this message is printed when first app in KDE session is started. I am using KDialog to get some choice and this message is landing in kdialog output.

Solution: change this puts into kdDebug()
Comment 1 Krzysztof Lichota 2006-12-19 21:28:22 UTC
BTW. It is not the only app which uses puts to print debugging output, according to lxr.kde.org.
Comment 2 Krzysztof Lichota 2006-12-19 22:04:21 UTC
And kinit also prints some messages to stdout:
Comment 3 Robert Knight 2006-12-19 23:51:36 UTC
Created attachment 18984 [details]
Updated binaries for kwrited which fix this bug.

Extract to /usr on Debian systems.
Comment 4 Robert Knight 2006-12-19 23:53:34 UTC

Sorry, I meant to add this comment to the attachment.  Could you test the patched version of kwrited attached to this bug report.  It will still print the error message (unlike kdDebug which disappears when compiled in release mode), but to stderr instead.

If it does what you need I will commit the changes for KDE 3.5.6
Comment 5 Krzysztof Lichota 2006-12-20 12:46:13 UTC
It would be hard for me to test your binaries as this problem appears when using LiveCD image. If you really want, I will remaster CD to include your binaries, but I think the fix is simple enough to put in without testing binaries. I would expect that if any problems appear they would be related on depending on kwrited writing this to stdout. But I don't think it is the case. Anyway, it would be best to put this fix in as soon as possible, so that people start testing it on their complete KDE desktop.

And kwrited problem is only part of solution, the problem with kinit stays and spoils the output also.
Comment 6 Robert Knight 2006-12-20 16:21:39 UTC
> It would be hard for me to test your binaries as this problem 
> appears when using LiveCD image.

I see.  Trying to build a new LiveCD would be overkill.  

> think the fix is simple enough to put in without testing binaries.

I suppose this is true.  I have committed the change.
Comment 7 Krzysztof Lichota 2006-12-21 00:23:43 UTC
Thanks for quick fix for the bug. I wish other developers fixed bugs that quickly :)
Comment 8 George Kiagiadakis 2008-10-21 15:40:23 UTC
SVN commit 874385 by gkiagia:

Use KNotify in kwrited instead of popping up a QTextEdit.
FEATURE: 104019

Also, fix various other minor things in kwrited:
* Remove the useless includes.
* Use KPtyDevice instead of KPty and direct system calls.
* Remove the bell character together with carriage return from incoming
* Change the component name from "konsole" to "kwrited".
* Cleanup out-of-date comments and commented-out code.
* puts() becomes kDebug(). CCBUG: 139025

 M  +1 -0      CMakeLists.txt  
 M  +18 -82    kwrited.cpp  
 M  +8 -11     kwrited.h  
 A             kwrited.notifyrc  

WebSVN link: http://websvn.kde.org/?view=rev&revision=874385