From e65adccd6f4c89478d19ed23c22111a934ad35fe Mon Sep 17 00:00:00 2001 From: Earl Ou Date: Tue, 1 Nov 2022 01:00:57 -0700 Subject: [PATCH] util: update termios to replace nl with cr-nl This change enables OPOST to enable output post-processing. It then enables ONLCR to prepend newline characters with carriage return so that start of each line is always left aligned. Note that on some terminals this might display a redundant ^M. Change-Id: Ia0b4c61725ab7478e7341273a8279b96e53d9f26 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/65152 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- util/term/term.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/term/term.c b/util/term/term.c index ca88ad47e4..529712c870 100644 --- a/util/term/term.c +++ b/util/term/term.c @@ -302,8 +302,8 @@ raw_term() memcpy(&saved_ios, &ios, sizeof(struct termios)); ios.c_iflag &= ~(ISTRIP|ICRNL|IGNCR|ICRNL|IXOFF|IXON); - ios.c_oflag &= ~(OPOST); - ios.c_oflag &= (ONLCR); + ios.c_oflag |= OPOST; + ios.c_oflag |= ONLCR; ios.c_lflag &= ~(ISIG|ICANON|ECHO); ios.c_cc[VMIN] = 1; ios.c_cc[VTIME] = 0;