Mail Archives: cygwin/1999/01/14/10:39:23
I would like to run a character based program on a nt4
via telnet from vt320 terminals. The program has to be
able to read characters one at a time. You know it has
to respond without pressing <enter>. The telnet server
compiled with cygwin doesn't work.
But i have had partial success with the one from ataman
if i compile the program with cygwin using the
code i found in the unix faq for doing this kind of
processing.
void set_keypress(void)
{
struct termios new;
tcgetattr(0,&stored);
memcpy(&new,&stored,sizeof(struct termios));
/* Disable canonical mode, and set buffer size to 1 byte */
new.c_lflag &= (~(ICANON|ECHO));
new.c_cc[VTIME] = 0;
new.c_cc[VMIN] = 1;
tcsetattr(0,TCSANOW,&new);
return;
}
However it has problems with certain long terminal escape sequences
like the one for F11
it should be <esc>[23~
but instead the program reads <esc><esc>[2~~
shorter sequences work alright.
------------------------------------------------------------------------
Erik Westlin Manne Siegbahn Laboratory
email: westlin AT msi DOT se
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -