Bug in curses package

Lorien Y. Pratt lorien at dartvax.UUCP
Thu May 24 05:45:18 AEST 1984


When I saw Mike Laman's bug fix for lack of scrolling in Curses,
I thought it was just the thing to help us avoid an anticipated need to
hack our C program to get around curses so that scrolling worked at a
decent rate.  Problem is, the bug fixes he proposes *don't work* at our
(4.2bsd) installation.  As it's not documented in the curses manual,
perhaps I simply don't know how to get the screen to scroll.

All I want to do is to display pages of data to users without clearing
the screen between pages but rather to begin scrolling in a new page
when they press some character indicating they want to go on.

Here's the program I wrote to test if introducing Laymen's bug
fix worked (only #1 on his list was not already fixed).  *Tell me* how
to modify Curses so that it uses the built-in scrolling facilities of
my terminal instead of redrawing it all.

/* Start of curtest.c */
#include<curses.h>
#include <stdio.h>

main()
{
char temp[256];
char t;
int i;

initscr();
scrollok( stdscr, TRUE );

for(i=0;i<24;i++)
{
  sprintf( temp, "This        is        the        line   numbered   %d", i );
  mvaddstr( i, 0, temp );
  refresh();
}
t = getch();
for(i=24;i<50;i++)
{
  scroll( stdscr );
  sprintf( temp, "Line %d", i );
  mvaddstr( 23, 0, temp );
  refresh();
}
endwin();
}
/* End of curtest.c */

Compile by:
  cc curtest.c -lcurses -ltermlib
Run by:
  a.out



More information about the Comp.bugs.4bsd.ucb-fixes mailing list