Properly save and restore the terminal characters!

This commit is contained in:
Jordan K. Hubbard 1996-03-01 18:21:41 +00:00
parent 7bb6870434
commit 47f8b1da86
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14310

View File

@ -57,6 +57,7 @@ int std_in = 0, std_out = 1;
int clear_ok = 0;
struct sgttyb sgo;
struct tchars tco;
char tbuf[1024], buf[1024];
@ -91,9 +92,9 @@ set_tty()
struct tchars tc;
ioctl(std_in, TIOCGETP, &sgo);
ioctl(std_in, TIOCGETC, &tc);
/* bcopy(&sgn, &sgo, sizeof(struct sgttyb)); */
ioctl(std_in, TIOCGETC, &tco);
sgn = sgo;
tc = tco;
sgn.sg_flags |= CBREAK;
sgn.sg_flags &= ~ECHO;
ospeed = sgo.sg_ospeed;
@ -107,6 +108,7 @@ void
unset_tty()
{
ioctl(std_in, TIOCSETP, &sgo);
ioctl(std_in, TIOCSETC, &tco);
}