summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mg/ttyio.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/usr.bin/mg/ttyio.c b/usr.bin/mg/ttyio.c
index 5870d6cb901..236c26e274a 100644
--- a/usr.bin/mg/ttyio.c
+++ b/usr.bin/mg/ttyio.c
@@ -17,6 +17,10 @@
#define NOBUF 512 /* Output buffer size. */
+#ifndef TCSASOFT
+#define TCSASOFT 0
+#endif
+
char obuf[NOBUF]; /* Output buffer. */
int nobuf; /* buffer count */
@@ -55,6 +59,16 @@ ttopen()
nt.c_oflag &= ~OPOST;
nt.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+#if !TCSASOFT
+ /*
+ * If we don't have TCSASOFT, force terminal to
+ * 8 bits, no parity.
+ */
+ nt.c_iflag &= ~ISTRIP;
+ nt.c_cflag &= ~(CSIZE|PARENB);
+ nt.c_cflag |= CS8;
+#endif
+
ttysavedp = TRUE;
}