[13339] in Athena Bugs
decmips 7.7L: curses library
daemon@ATHENA.MIT.EDU (bcb@MIT.EDU)
Sat Mar 18 22:11:36 1995
From: bcb@MIT.EDU
To: bugs@MIT.EDU
Date: Sat, 18 Mar 1995 22:11:28 EST
System name: w20-575-62
Type and version: KN02ca 7.7L
Display type: PMAG-DV
What were you trying to do?
I'm using the curses library to try to manage a terminal display.
I have several windows on the screen, created with code like the following:
ftermwin = newterm("vt100", ftermout, ftermin);
/* ftermout and ftermin are two handles for the same file, */
/* which is "/dev/ttyp2" which is running an xterm */
/* This xterm is 25 by 80, and curses is told this. */
initscr();
.
.
.
win = newwin(3, COLS, 22, 0);
if (!win)
/* display error code on stderr */;
scrollok(win, 0); /* I've tried setting this to 1, too; no effect */
wrefresh(win);
waddstr(win, "Line 1");
wrefresh(win);
/* That does what it should: displays "Line 1" at the top */
/* left of the curses window, which is to say line 22 of */
/* the xterm window. */
waddstr(win, "\n");
wrefresh(win);
/* This causes the "Line 1" to scroll up one line -- which it */
/* should not! -- and the cursor to be replaced where it was */
/* before. In other words, the text "Line 1" ends up on line */
/* *21* of the xterm window -- OUTSIDE the curses window! */
/* and the cursor ends up on line 22, at the top of the curses */
/* window. */
/* What should happen is that the "Line 1" text should not move, */
/* but the cursor should move down to the start of the next line. */
waddstr(win, "Line 2");
wrefresh(win);
/* This causes no text at all to be displayed anywhere, but */
/* the cursor moves to where it should be if the text had been */
/* displayed. */
/* What should happen is that "Line 2" should be displayed starting */
/* where the cursor is (which should be on line 22 of the xterm */
/* window, but isn't, because of the previous error. */
Please describe any relevant documentation references:
man 3cur waddstr
man 3cur waddch
man 3cur newwin
and so on
I'm not sure this is a bug in curses, but it looks like one to me. I
don't know of anywhere better to look to find out what's wrong.
Things *do* work correctly when I don't use newlines and expect curses
to scroll properly. For example, if all text is drawn in specific
locations on the screen, things seem to work okay. Also, in a
different curses window, scrolling does seem to work. (I have a total
of five curses windows on the xterm window.)
Brian