Bug 78748 - no way to both clear the terminal and clear the history with one shortcut
Summary: no way to both clear the terminal and clear the history with one shortcut
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 1.3.1
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-30 17:22 UTC by David Gerber
Modified: 2007-05-08 01:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Gerber 2004-03-30 17:22:53 UTC
Version:           1.3.1 (using KDE 3.2.1,  (testing/unstable))
Compiler:          gcc version 3.3.3 (Debian)
OS:          Linux (i686) release 2.6.4

I use terminals to read debugging output from another machine. Once I'm done with a debugging session I'd like to clear the whole konsole (terminal *and* history). It would be nice if there was a way to perform these 2 actions in one go. If that clutters the menu entries, a shortcut action of "Clear History & Terminal" would do just fine.
Comment 1 Kurt Hindenburg 2005-02-03 07:13:23 UTC
A shortcut may be possible; but it may not happen for a while (if every).


Use this small script to do this; use an alias for easy usage.

#!/bin/sh

clear

# Assuming only one konsole running
KONSOLE=`dcop | grep konsole`

SESSION=$(dcop $KONSOLE konsole currentSession)
# or 
#SESSION=$(dcop $KONSOLE_DCOP currentSession)


dcop $KONSOLE $SESSION clearHistory

Comment 2 Justin Mason 2005-05-28 01:42:21 UTC
hi there -- oddly, that script no longer seems to work, although the vars make sense when it's done through kdcop.  I get:

dcop 'DCOPRef(konsole-10158,konsole)' session-4 clearHistory
no such function

(that's the right DCOPRef and session object according to kdcop.)

anyway -- I actually wanted to add this: it seems that "clear history" has been assigned an unofficial CSI sequence by XTerm in this change:

http://cvsweb.xfree86.org/cvsweb/xc/programs/xterm/xterm.log.html?rev=1.57#xterm_107

the seq is ESC[3J . it's been in XTerm since 1999.   it'd be really nifty if Konsole could support this...
Comment 3 Kurt Hindenburg 2005-05-28 07:19:44 UTC
This does work:
dcop konsole-7804 session-1 clearHistory

Your link is for XFree86's xterm which I don't use...

As far as the control seq, look at ctrlseq.ms in the xterm package.

http://dickey.his.com/xterm/xterm.faq.html
Comment 4 Robert Knight 2007-05-08 01:03:31 UTC
Fixed in KDE 4.  Ctrl+Shift+X shortcut clears terminal and history.