=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/ttyio.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/mg/ttyio.c 2000/02/27 05:52:32 1.5 +++ src/usr.bin/mg/ttyio.c 2000/02/27 17:24:12 1.6 @@ -47,19 +47,18 @@ if (tcgetattr(0, &ot) < 0) abort(); nt = ot; /* save entry state */ - nt.c_cc[VMIN] = 1; /* one character read is OK */ - nt.c_cc[VTIME] = 0; /* Never time out. */ + /* Set terminal to 'raw' mode and ignore a 'break' */ + nt.c_cc[VMIN] = 1; + nt.c_cc[VTIME] = 0; nt.c_iflag |= IGNBRK; - nt.c_iflag &= ~( ICRNL | INLCR | ISTRIP | IXON | IXOFF ); + nt.c_iflag &= ~(BRKINT|PARMRK|INLCR|IGNCR|ICRNL|IXON); nt.c_oflag &= ~OPOST; - nt.c_cflag |= CS8; /* allow 8th bit on input */ - nt.c_cflag &= ~PARENB; /* Don't check parity */ - nt.c_lflag &= ~( ECHO | ICANON | ISIG ); + nt.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); ttysavedp = TRUE; } - if (tcsetattr(0, TCSAFLUSH, &nt) < 0) + if (tcsetattr(0, TCSASOFT | TCSADRAIN, &nt) < 0) abort(); ttyactivep = TRUE; @@ -75,7 +74,7 @@ if(!ttysavedp || !ttyactivep) return; ttflush(); - if (tcsetattr(0, TCSAFLUSH, &ot) < 0) + if (tcsetattr(0, TCSASOFT | TCSADRAIN, &ot) < 0) abort(); ttyactivep = FALSE; }