bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cursor position not restored


From: Aleksander Budzynowski
Subject: Cursor position not restored
Date: Fri, 6 Aug 2010 23:09:32 +1000

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]