Clearing konsole history with dcop

Here’s another quick tip for manipulating your Konsole sessions using DCOP. Need to clear the history buffer in an automated fashion for some reason? Use DCOP!

There are three steps to this endeavor:

  1. Find out the reference to the application.
  2. List the available methods (just so you know what’s available).
  3. Send your Konsole session a command!

Here’s an example:

rwoodrum@frums:~$ echo $KONSOLE_DCOP_SESSION
DCOPRef(konsole-12065,session-1)
rwoodrum@frums:~$
rwoodrum@frums:~$ dcop konsole-12065 session-1
QCStringList interfaces()
QCStringList functions()
bool closeSession()
bool sendSignal(int signal)
void clearHistory()
void renameSession(QString name)
QString sessionName()
int sessionPID()
QString schema()
void setSchema(QString schema)
QString encoding()
void setEncoding(QString encoding)
QString keytab()
void setKeytab(QString keyboard)
QSize size()
void setSize(QSize size)
rwoodrum@frums:~$
rwoodrum@frums:~$ dcop konsole-12065 session-1 clearHistory
rwoodrum@frums:~$

Voila! History cleared.

Comments

Leave a Reply