Konsole cutting off half the screen when using vi or less

Using konsole it keeps cutting off half the screen when using vim or less, see screenshot SUSE Paste

Anyone seen this before and now how to stop it?http://paste.opensuse.org/images/55180558.png

Check your startup files (".profile" or “.bashrc”). You probably have a “stty” command that is setting 24 lines. Try removing (or commenting out) that command.

On 06/30/2011 12:06 PM, tk83 wrote:
> Using konsole it keeps cutting off half the screen when using vim or
> less

the paste you show is of vim, right?

this http://paste.opensuse.org/80873573 shows the results of this code

cat hardware.txt | less

in a default installed openSUSE 11.4, proving (i think) that no
truncation occurs when using less by itself as your post would suggest…

so, either you used less AND vim together, or i have to wonder if maybe
you have changed your default bash or konsole settings…

maybe in .bashrc ??

by the way, i must admit total ignorance in the mysteries of vi/vim, i
have also gotten lost in its arcane blind passage ways and dead end
caves…and have myself gotten into a ‘mode’ where nothing makes sense
(like the one you posted)…while i hope a vim guru can help you, i do
not think less is involved in any way…


This is a default Opensus 11.4 install, I haven’t added or changed anything in .profile, .bashrc, .bash_profile or anything.

I’m not using less and vim together, I’m using them in the perfectly normal way separately. Those are just the 2 applications that seem to show the problem.

The only thing I’ve found out so far is that it only occurs on my Opensuse 11.4 that’s in a VirtualBox VM, the installation running natively on my laptop at home doesn’t show the problem.

Okay. I’m not a VirtualBox user, so hopefully somebody else can point to the problem.

You will get that behavior when “vi” or “less” is told the wrong number of rows for the screen. Typically, it is the “stty” command that can set a wrong number. But it might be something else in your VirtualBox settings.

On 06/30/2011 02:06 PM, nrickert wrote:
> But it might be something else in your VirtualBox settings.

i agree because we are (i think) sure that neither less nor vim will do
in a local terminal what is being seen by tk83 in a VM, at work…

or maybe it is a problem between VBox and the host it is running in at

try running openSUSE in a VBox on your home linux machine and see it if
also truncates konsole when running vim or less…if so, you know it is
a VBox problem, if not you know it is a problem when VBox is running in
your office software problem…right? so what is the hosting software
running at work–if, the problem is only there?


At work I (unfortunately) am stuck with Windows XP on my laptop, so that’s the host that’s running the VBox VM. I can try copying the 5GB VM to my home but it might have to wait until next week as my only USB stick large enough is currently being used for something else.

I’ve tried a few other applications and it seems to be a general problem that affects anything that uses curses/ncurses for the interface. So the list of programs which can reproduce the problem includes vim, less, ncftp, GNU screen and links.

Anyone ever had a problem like this with konsole and n/curses programs?

The fact that it happens with other programs is rather normal. You can try the following:

  • check/set the TERM
    environment variable. - use the **resize **
    command before running a ncurses program. - try another terminal program like xterm

I don’t know how it could be related to VirtualBox (actually I don’t think it is).

  • and use a bitmap font.

[/li]echo $TERM

[li]use the resize command before running a ncurses program.[/li]
Bingo! That did the trick. There must still be a bug somewhere that it’s not doing this by default.

Found the bug: https://bugs.kde.org/show_bug.cgi?id=176902

And the explanation is that it only affects you if the konsole terminal size is exactly 80x40. So just grabbing the corner of the konsole window and extending it to 80x41 works around the bug completely, without having to use resize.