Subject: curses problem
To: None <email@example.com>
From: Christian Groessler <firstname.lastname@example.org>
Date: 03/31/2001 22:58:57
I tried to write my first program which uses the curses library. I
found a problem (which surely comes from my cluelessness of curses) so
I'm asking for help.
I'm using scanw() for get some input data from the user.
This works fine on all terminals I've tried, but when running in a
telnet session the enter key to finish the input isn't handled
It doesn't end the input, it does a CR and the next key pressed
appears at the beginning of the line. (Ctrl-J works for ending the
I've played with stty settings to no avail, icrnl is set.
I also tried on Solaris and Linux (which uses ncurses) and there the
problem isn't present. Also if I use ncurses from /usr/pkg it works.
Is this a bug in the NetBSD curses lib? I assume no, but then what am
I doing wrong?
I've attached a simple test program.
------------------------ [cut here]
# include <ncurses.h>
# include <curses.h>
void putsat( int x, int y, char *s )
/* Show a string at x,y, also erasing to end of line */
move( y, x );
addstr( s );
int main( int argc, char **argv )
int val1, val2;
putsat(10,2, "Test Program");
putsat( 1, 5, "Value 1: " );
scanw( "%d", &val1 );
if( !val1 ) /* enter 0 to exit... */
putsat( 1, 6, "Value 2: " );
scanw( "%d", &val2 );
if( !val2 ) /* enter 0 to exit... */
printf("\n\n\tVal1: %d, Val2: %d\n",val1, val2);
------------------------ [cut here end]