konsole cutting off half the screen with any program that uses ncurses

Duncan 1i5t5.duncan at cox.net
Fri Jul 1 12:21:08 BST 2011

Tim Edwards posted on Fri, 01 Jul 2011 11:11:27 +0200 as excerpted:

> I'm having a problem where konsole will not use the bottom half of the
> terminal window when any program with an ncurses UI is being run within
> it.
> This is best explained with a screenshot:
> http://paste.opensuse.org/images/55180558.png
> The applications I've tried so far which show the problem are vim, less,
> ncftp, GNU screen and links.
> The distro is Opensuse 11.4 with KDE 4.6.0 and all updates applied from
> the opensuse update repo. The machine is a Virtualbox VM.
> Can anyone here help with this?

That is almost certainly KDE bug #176902.  Multiple tabs, check.  24 
lines instead of 40, check.



At least Gentoo (what I run) recently patched it, the reason the bug is 
fresh in my mind as I saw it in a gentoo konsole package changelog entry 
dated June 19th.

There's a couple workarounds available while you're waiting for the patch 
to hit your distro:

One is to arrange for the konsole size to be something other than the 
default 80x40 when it starts.  You can do this by either checking that 
the save window size and position checkbox found on the general tab of 
the profile settings is checked, and resizing to something than the 
default 80x40 chars size, then quitting, or by using kwin's window rules 
(what I had done, the reason I never noticed the bug here).

The other is a bit more technical.  In your ~/.bashrc, script a SIGWINCH 
sent to the bash process as it starts up.  This should cause it to check 
its window size and set the $LINES and $COLUMNS variables (which is what 
is set incorrectly that the ncurses programs are using) appropriately.  A 
commandline such as the following (untested) should do it, without 
causing any harm in a VC (outside of X).  (kill doesn't actually kill 
anything in this case, but rather sends the signal it's given on the 
commandline, #28, the sigwinch signal, instead of the default #15, 
sigterm, which /would/ normally cause a termination/kill.  $$ is bash 
notation for its own PID, so the effect is that bash sends itself the 
sigwinch signal, triggering the desired recalculation.)

kill -28 $$

That's untested, obviously as I never had the problem to test it on and 
didn't even know about the problem until I read the gentoo changelog 
entry, but I believe it should work.  You can just use the window resize 
and save trick instead, if you don't do enough shell scripting to 
understand the line and/or are uncomfortable with it (or if it doesn't 
work, for some reason).

Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.

More information about the kde mailing list