[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cursor position not restored
From: |
Aleksander Budzynowski |
Subject: |
Re: Cursor position not restored |
Date: |
Sun, 8 Aug 2010 11:13:28 +1000 |
Actually I realised that I was using a fairly old version of PuTTY,
upgrading PuTTY fixed the problem (even with TERM=xterm).
Aleks
On 6 August 2010 23:09, Aleksander Budzynowski <address@hidden> wrote:
> I was using the Python curses module and I experienced this problem,
> so I recreated a minimal example in C which still had the problem.
>
> The problem seems to be triggered by this sort of procedure:
> 1. Write something to a window or pad.
> 2. Write something to another, scrollok, window or pad which causes it
> to scroll.
> 3. Exit cleanly.
> Result: The cursor is not restored to where it was before the program
> started, rather it seems to stay where the last write left it.
>
> Steps 1 and 2 can occur in the opposite order. The bug may or may not
> occur given a certain combination of window size, location, and amount
> of scrolling.
>
> The problem occurs in PuTTY. It doesn't seem to occur in an XTerm.
> Observed with library versions 5.6 and 5.7 so far.
>
> Here is a program that triggers the problem.
>
> #include <ncurses.h>
> int main() {
> initscr();
>
> WINDOW *w = newwin(10, 80, 5, 0);
> waddstr(w, "X");
>
> //if this line is removed, the problem does not occur
> wrefresh(w);
>
> WINDOW *w2 = newwin(4, 80, 0, 0);
> scrollok(w2, 1);
> waddstr(w2, "1\n2\n3\n4\n");
>
> //if this line is removed, the problem does not occur
> wrefresh(w2);
>
> waddstr(w2, "5\n");
>
> //if this line is removed, the problem does not occur
> wrefresh(w2);
>
> endwin();
>
> return 0;
>
> }
>
> Thanks,
> Aleks
>