Subject: terminal telnet processing
From: [email-masked] (Erik Westlin)

14 Jan 1999 10:39:23 -0800
Message-ID: <[email-masked]>
Reply-To: [email-masked]
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: [email-masked]

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: [email-masked]
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".