From 473aab977cc286839a94d0efe3f011ba71a81a68 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 14 Feb 1996 22:07:04 +0000 Subject: (init_termstate, restore_termstate, term_sgb, localbits): Moved here from boot.c --- boot/ux.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'boot') diff --git a/boot/ux.c b/boot/ux.c index 46e2f130..0a34b25f 100644 --- a/boot/ux.c +++ b/boot/ux.c @@ -241,3 +241,31 @@ printf (const char *fmt, ...) return 0; } + +static struct sgttyb term_sgb; +static int localbits; + +void +init_termstate () +{ + struct sgttyb sgb; + int bits; + ioctl (0, TIOCGETP, &term_sgb); + ioctl (0, TIOCLGET, &localbits); + /* Enter raw made. Rather than try and interpret these bits, + we just do what emacs does in .../emacs/src/sysdep.c for + an old style terminal driver. */ + bits = localbits | LDECCTQ | LLITOUT | LPASS8 | LNOFLSH; + ioctl (0, TIOCLSET, &bits); + sgb = term_sgb; + sgb.sg_flags &= ~ECHO; + sgb.sg_flags |= RAW | ANYP; + ioctl (0, TIOCSETN, &sgb); +} + +void +restore_termstate () +{ + ioctl (0, TIOCLSET, &localbits); + ioctl (0, TIOCSETN, &term_sgb); +} -- cgit v1.2.3