[Konsole-devel] Bug#39640: marked as done (cursor not in proper place after exiting ncurses applications) by Waldo Bastian <bastian at kde.org>
Stephan Kulow
owner at bugs.kde.org
Fri Mar 22 05:48:12 UTC 2002
Your message with subj: [Konsole-devel] Bug#39640: cursor not in proper place after exiting ncurses applications
On Thursday 21 March 2002 06:54 pm, derekp1 at needcaffeine.net wrote:
> The
> best way to reproduce this is to get the konsole window full of text, t=
hen
> issue the four escape sequences at the top of this report. If the curso=
r
> returns to where you left off, the bug is gone, but if it goes to the t=
op
> of the screen, the behaviour is still there.
Appears to be fixed in KDE 3.0
Cheers,
Waldo
--=20
bastian at kde.org | SuSE Labs KDE Developer | bastian at suse.com
has caused the attached bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I'm
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Stephan Kulow
(administrator, KDE bugs database)
Received: (at submit) by bugs.kde.org; 22 Mar 2002 02:54:45 +0000
Received: (qmail 28749 invoked by uid 33); 22 Mar 2002 02:54:45 -0000
Date: 22 Mar 2002 02:54:45 -0000
Message-ID: <20020322025445.28748.qmail at mail.kde.org>
To: submit at bugs.kde.org
Subject: cursor not in proper place after exiting ncurses applications
From: derekp1 at needcaffeine.net
X-KDE-Received: -208.176.197.194
Package: konsole
Version: 1.0.2 (using KDE 2.2.2 )
Severity: normal
Installed from: compiled sources
Compiler: gcc version 2.95.3 20010315 (release)
OS: Linux (i686) release 2.4.16
OS/Compiler notes:
Summary:
After exiting vim or less in a konsole session, the cursor goes to the upper-left corner of the screen, with the original screen contents visible. The xterm included with xfree86 4.2 will always return the cursor to original posistion when exiting these programs instead of to position 1,1. Both are linked against ncurses 5.2
Details:
The escape sequence that reproduces this behaviour on konqueror yet produces other behaviour on other xterms (varries, see below) is as follows:
[on program startup]
Esc[?1049h (switch to alternet screen buffer)
Esc[1;24r (set top and bottom margin)
[on program exit]
Esc[24;1H (set cursor position (bottom left corner))
Esc[?1049l (return to default screen buffer)
Now, what happens is that Esc[?1049h folowed by any arbitrary text and cursor movement, then followed by Esc[?1049l will do the desired behaviour, that is return the cursor to the same position as before the Esc[?1049h was issued. However, the Esc[1;24r (set top/bottom margin) ends up putting the cursor at position 1,1 in _both_ screen buffers in konsole, but not in xterm (Xfree86 4.2.0). The margin set (a.k.a. window set) command does, however, affect both screen buffers in some other xterms I've worked with (specifically what is included with Solaris 2.6), but in those xterms, the Esc[24;1H _also_ affects both screen buffers, such that when vi exits, it will deposit the cursor at the lower-left part of the screen so that your not typing over other text on the screen (konsole has Esc[24;1H only affect the current screen).
This bug may be a bit difficult to reproduce since I noticed that some other curses packages don't issue the Esc[1;24r on initialization. The best way to reproduce this is to get the konsole window full of text, then issue the four escape sequences at the top of this report. If the cursor returns to where you left off, the bug is gone, but if it goes to the top of the screen, the behaviour is still there.
There are two ways to fix this in konsole:
a) To get Xfree86 4.2.0's xterm behaviour, in the file TEmuVt102.C, function TEmuVt102::setMargins (line 875), change the lines:
screen[0]->setMargins(t, b);
screen[1]->setMargins(t, b);
to
scr->setMargins(t, b);
Or, you can:
b) To get the other xterm's behaviour, change any line in TEmuVt102.C that calls
scr->setCursorYX(p, q);
to
screen[0]->setCursorYX(p, q); screen[1]->setCursorYX(p, q);
(specifically, the one at line 520, but the others may apply also).
(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
More information about the konsole-devel
mailing list