Thank you for your help,
-Peter
Full-screen programs like these often make use of /dev/tty rather than
stdin, stdout, and stderr. In particular, consider:
someprogram | more
more's stdin is the pipe, so it uses /dev/tty to perform user interaction.
It sounds like your program is not setting up the controlling terminal
properly.
--
Barry Margolin, barry.m...@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
see the termio man page
shiu...@yahoo.com (Peter Tan) wrote in message news:<151c6c1d.03090...@posting.google.com>...
I was working on a similar problem and this source code:
http://people.redhat.com/johnsonm/lad/src/ptytest.c.html
helped me a lot.
Especially this part should help you:
tcgetattr(STDIN_FILENO, &ot);
t = ot;
t.c_lflag &= ~(ICANON | ISIG | ECHO | ECHOCTL | ECHOE | \
ECHOK | ECHOKE | ECHONL | ECHOPRT );
t.c_iflag |= IGNBRK;
t.c_cc[VMIN] = 1;
t.c_cc[VTIME] = 0;
tcsetattr(STDIN_FILENO, TCSANOW, &t);
Michael.