From 6505d10ccf0a00298faa8f738a108a1d6dfcc368 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 21 Dec 2010 12:22:07 -0500 Subject: [PATCH] Clear OPOST from c_oflag like we used to. Fixes screen-based editors such as vi. --- common/term.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/term.c b/common/term.c index 02b1c45d2..1e7f7c343 100644 --- a/common/term.c +++ b/common/term.c @@ -107,10 +107,11 @@ term_raw(int fd, int isig) /* Set terminal to raw mode */ term.c_cc[VMIN] = 1; term.c_cc[VTIME] = 0; - CLR(term.c_lflag, ECHO | ECHONL | ICANON | ISIG | IEXTEN); + CLR(term.c_iflag, ICRNL | IGNCR | INLCR | IUCLC | IXON); + SET(term.c_oflag, OPOST); + CLR(term.c_lflag, ECHO | ICANON | ISIG | IEXTEN); if (isig) SET(term.c_lflag, ISIG); - CLR(term.c_iflag, ICRNL | IGNCR | INLCR | IUCLC | IXON); if (tcsetattr(fd, TCSADRAIN|TCSASOFT, &term) == 0) { changed = 1; return(1); -- 2.40.0