MAR
22
2004

Application of the Month: Konsole

As part of the March 2004 issue
of the "Application of the month" series on KDE.de, Andreas C. Diekmann
has interviewed Lars Doelle, author of
Konsole. Konsole is what is known as an X terminal emulator and gives you the equivalent of an old-fashioned text screen on your desktop, but one which can
easily share the screen with your graphical applications. The Dutch KDE website is
offering an English translation of the interview
and the overview of this issue. Many thanks to Tom Verbreyt and Wilbert Berendsen for their help in translating this issue.

Comments

You can do this with tcsh, though I admittedly haven't actually tried it, but I'm sure you can. See tcsh's special variables and a special alias (all of which I forget the name of since I haven't used them recently) to execute a command before each prompt. I set the title of my konsole screens like this, which you could take a mess with.

setenv XTITLE "!*";cwdcmd; dcop `echo $KONSOLE_DCOP_SESSION | sed "s/DCOPRef.//;s/,.*//"` `echo $KONSOLE_DCOP_SESSION | sed "s/.*,//;s/)//"` renameSession "$XTITLE"

I realize I haven't been a great help, but I can only offer a starting suggestion since I don't have any more time.


By Wes Hardaker at Mon, 2004/03/22 - 6:00am

This is not really what you're looking for, but you might find it useful:

http://kde-look.org/content/show.php?content=6976


By Aurélien Gâteau at Mon, 2004/03/22 - 6:00am

This depends on which shell you use: you can do it in tcsh or zsh using the 'postcmd' or 'preexec' hooks [1, 2]. Unfortunately, as others have said, you can't do it in standard bash because it lacks such a hook [3]. (There is, however, a patch to add it [4, 5].)

[1] http://cns.georgetown.edu/~ric/howto/Xterm-Title/Xterm-Title-5.html
[2] http://www.macosxhints.com/article.php?story=20020207093427440
[3] http://www.kuro5hin.org/comments/2003/4/22/0206/78523?pid=19
[4] http://mail.gnu.org/archive/html/bug-bash/2003-10/msg00034.html
[5] http://noxa.de/~rvb/pub/patches/


By hysterion at Tue, 2004/03/23 - 6:00am

I am wondering how make it stop! I does it all the time for me, which is embarresing when I am logging onto a SQL-server using a clear-text password after --password.


By Allan Sandfeld at Tue, 2004/03/23 - 6:00am

I added this to my .cshrc

if ("$TERM" == "xterm") then
alias precmd 'echo -n "\033]0;`history | tail -n 1 | cut -f 3-`\007"'
endif


By Stephen at Wed, 2004/08/18 - 5:00am

So... is anyone convinced that Konsole needs to put back in the Kicker default yet?

I know I am!


By ac at Mon, 2004/03/22 - 6:00am

I second the motion. Konsole needs to remain on Kicker! If some particular distro can't stand this, then they can trivially change it for themselves. Konsole is there for a purpose. I am getting sick of this attitude that usability means dumbing down the interface.


By David Johnson at Mon, 2004/03/22 - 6:00am

> I am getting sick of this attitude that usability
> means dumbing down the interface.

good thing that wasn't why it was done, then =)


By Aaron J. Seigo at Mon, 2004/03/22 - 6:00am

Perhaps "dumbing down" was the wrong phrase. Maybe I'm just an old fart out of touch with the times, but for me Konsole is one of the most frequently used applications in KDE. It's the primary starting point for most of my tasks.

I realize that there is very limited room on Kicker, and that stuff needs to be prioritized. The question is whether we prioritize according to the needs of the ex-Windows user who has no idea what a terminal is, or prioritize for the current Unix user who sees the command line as a useful tool.

So why was it done? Set an old codger straight in his ways...


By David Johnson at Tue, 2004/03/23 - 6:00am

I'm curious. Why does console need to remain in the kicker? I mean, I use the konsole all the time (I've got half a dozen open at any given time) but I see no reason it needs to remain in the default kicker. Certainly, I'd wager most KDE users don't use it enough to warrent it.


By Rayiner Hashem at Mon, 2004/03/22 - 6:00am

Are you kidding? No matter what you do, almost all linux users need the command line from time to time. Konsole and Firefox are the ONLY icons I need in kicker. It's trivial to add them myself, of course, but I really can't see how anything else can warrant inclusion by default over konsole.


By Nick Matteo at Tue, 2004/03/23 - 6:00am

> I am getting sick of this attitude that usability means dumbing down the interface.

Getting rid of konsole from the default kicker config was dumbing down the interface? Just found that comedic.

That is all.


By Sashmit Bhaduri at Tue, 2004/03/23 - 6:00am

My counterargument at the time was that people who use consoles have their hands at the keyboard, and for them doing an alt-f2; ko is way more comfortable than pulling mouse to icon. I don't think that has changed.


By Cloaked Penguin at Tue, 2004/03/23 - 6:00am

True..

Or.. use KHotkeys to set up a hotkey shortcut, as I have for all my frequently used apps.

I have one of those fancy keyboards with a bunch of "multi-media" and "internet" keys, and set up one of them, XF86WWW, as the "user-menu" key. "UMenu, C" gives me a konsole, "UMenu, Ctrl-C" gives me the KDESU prompt and then a root konsole. F/Ctrl-F work the same way as C/Ctrl-C but for file management (Konqueror). E/Ctrl-E are the same for editing (KWrite), N for news (PAN, since KNode doesn't do yEnc, last I checked), M for Mail (KMail), G for one game, Ctrl-G for another, etc. I use Alt, as in Alt-E, for alternatives, so UMenu, Alt-E, for instance, opens KHexEdit.

I haven't set up any mouse gestures yet, as I just installed KDE 3.2 since Mandrake is a bit behind on AMD64 and just came out with 3.2 for AMD64 (the reason I'm working on switching to Gentoo, BTW). I will eventually, most likely, but that isn't really appropriate for a konsole shortcut anyway, for the reasons you mentioned.

Duncan (who followed the link from LWN).


By Duncan at Thu, 2004/03/25 - 6:00am

I think KNode supports decoding of yEnc now. (As of KDE 3.2)


By jfb3 at Wed, 2004/03/31 - 6:00am

There is a spelling error in the name of the interviewee.


By Jens at Tue, 2004/03/23 - 6:00am

Thanks .. fixed

Fab


By Fabrice Mous at Tue, 2004/03/23 - 6:00am

i setup a few sessions in konsole like this:

ssh -t user@host screen -r -d ScreenSessionName

(menu, Settings, Configure Konsole, Session Tab -> Execute)

this way, i'm only one klick away from my remote hosts


By ac666 at Tue, 2004/03/23 - 6:00am

I can't type hindi in Konsole, even after setting the font to mangal (ms hindi unicode font).

And also, I can 't save a file with Hindi names (unicode characters). Though all the KDE environment looks hindi fine. But one can not have hindi file/folder names in KDE...


By _Fast_Rizwaan___ at Tue, 2004/03/23 - 6:00am

Indeed. My locale is "en_US.utf8" and I use gnome and gnome-terminal.

I tried konsole and I can't even type quotes or accented chars('"çéñŕģùŸ ...)


By A.N. Onimus at Tue, 2004/03/23 - 6:00am

If I type the following:
$ tes
and the available applications are test, testparm, and testprns, bash beeps and completes up to the "t":
$ test
This interacts with the Konsole visual bell in a way that bugs me immensely. Instead of printing the "t" and flashing to indicate the bell, Konsole flashes to indicate the bell, then prints the t. During the delay it looks like it can't complete anything at all!

My configuration has bell set to "System Bell" in Konsole, and "Use visible bell" under KDE Control Centre/Accessability/Use visible bell. Hmm... it actually seems to behave better when set to visual bell in Konsole itself.

My feature request: Make the visual bell concurrent with subsequent updates for the visual bell accessabilty option.

Benjamin.


By Benjamin. at Tue, 2004/03/23 - 6:00am

I like konsole - I like being able to have anti-aliased fonts, and have a widget set that fits with everything else, but there are a couple of features which I miss too much to give up using rxvt:

- Scrolling lots of text is very much slower than rxvt (which can slow compiles down!)

- I can't ask it that $DISPLAY is; rxvt can tell me. This feature can be very useful; I don't want to "ssh -X" all the time as that's slower.

The memory footprint could also be considered a point, but these days that's becoming more and more insignificant. I don't have a 486 w/ 12MB anymore. :-)

-- Steve


By Steve at Tue, 2004/03/23 - 6:00am

> - I can't ask it that $DISPLAY is; rxvt can tell me.

I don't understand what you mean. Asking within a program what environment variables are set?


By Anonymous at Tue, 2004/03/23 - 6:00am

It's not asking what environment variables are set directly. You probably know that you can do things like set the terminal title by echoing a command sequence. There are similar sequences for moving the cursor, setting colours, asking the terminal about itself and so on. One such sequence (^[[7n) will cause rxvt to write the name of the display it's on back to stdin, which you can read in and use to set $DISPLAY. You can configure rxvt (in the source) to give you either the hostname of the IP address.

It's a very nifty feature for those of us who use remote X apps. I'd very much like to have this in konsole as an option (disabled by default though).

-- Steve


By Steve at Wed, 2004/03/24 - 6:00am

If you really want to have a feature then please file a wishlist entry at http://bugs.kde.org.


By Anonymous at Wed, 2004/03/24 - 6:00am

I really like konsole but have to agree on the fact is it quite slow. It's not a problem normally, but the testbed for my programming project takes about 20 seconds to run in xterm and 35 seconds to run in konsole. It spits out a lot of debug text on the way, so konsole appears to be much slower in displaying it. In xterm, it just whizzes by. I'd rather use konsole, but for this instance the time really adds up and I am forced to use the more primitive xterm instead.


By Fred at Tue, 2004/03/23 - 6:00am

Sounds like something is wrong since obviously your choice of console shouldn't change what the environment variables are.

And you can't have your cake and eat it too. Scrolling takes a long time because of the anti-aliasing. When I'm doing large compiles I usually minimize Konsole since all that text scrolling by can take a chunk of CPU.


By Ian Monroe at Tue, 2004/03/23 - 6:00am

Try to use a non-antialiased bitmap font.


By Anonymous at Tue, 2004/03/23 - 6:00am

But then it will look ugly like xterm. :)

Couldn't the programmers implement something where it would be more conservative about how much text is displayed? My program spits out screens of data, so fast that you cannot read it. The only thing I need to know is that it is streaming out text (i.e. it hasn't stopped moving). Like a frames per second limiter or something.


By Fred at Tue, 2004/03/23 - 6:00am

This is a good idea.

What I could imagine is a jump-scroll mode, where instead of trying to scroll through everything, the konsole jumps to the bottom of what is visible, and just renders that.

If rendering the scrollable part (offscreen) means that this wouldn't help much, maybe limiting the scroll refresh to every 100ms or so and then jumping to the bottom would help. I've not looked at the konsole source, but I would guess they use a QTextSomething, and that that would only render the visible part - so doing the jump thing could be quite effective.

-- Steve


By Steve at Wed, 2004/03/24 - 6:00am

I've noticed it is slow on scrolling as well. The effect becomes more noticable when Konsole is displaying more text, however, so when I'm doing something like compiling a kernel or something, I shrink the konsole window down fairly small, and it the text whizes by as it normally does when I'm using a virtual console directly.

Duncan (who followed the link from LWN)


By Duncan at Thu, 2004/03/25 - 6:00am

Can this not be fixed with programming though? In some of my circumstances, I found xterm was about 50% faster at displaying large quantities of scrolling text. I would rather use konsole here and minimizing the window is a hacky solution that would not be practical in general.


By Fred at Thu, 2004/03/25 - 6:00am

Yep, I've noticed this too.. it's quite annoying.. rxvt is SO much faster.

It appears as tho konsole doesn't copy the part of the screen that is the same, then render the new part when scrolling text... it just redraws the whole thing. This is very expensive when antialias fonts are enabled.


By Davy Durham at Wed, 2004/04/14 - 5:00am

great interview, and thanks to Mr. Diekmann and Mr. Doulle!

-=WFA=-


By wfa at Tue, 2004/03/30 - 6:00am

Pages