summaryrefslogtreecommitdiff
path: root/com32/libutil/ansiraw.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-23 19:33:36 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-23 19:35:31 -0700
commit9d1cde418a4f0dc6cccf4af7eae340e75de2f3d4 (patch)
treeb106d1fc14c146652ece9df7023c7fe3726a5cba /com32/libutil/ansiraw.c
parentee89890b4008c40bd7d6ea5ddb1016b47fee7bbf (diff)
downloadsyslinux-9d1cde418a4f0dc6cccf4af7eae340e75de2f3d4.tar.gz
Don't set the autocr flag on the serial console; clean up crapsyslinux-3.81-pre12
libutil would set the autocr flag on the serial console, which really never was any point -- we already do \n -> \r\n conversion explicitly in the serial code. This was always very annoying to deal with if the menu was interrupted. Furthermore, drop completely unnecessary initialization/deinitialization routines that completely duplicated other code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/libutil/ansiraw.c')
-rw-r--r--com32/libutil/ansiraw.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/com32/libutil/ansiraw.c b/com32/libutil/ansiraw.c
index c1927445..c55a82ea 100644
--- a/com32/libutil/ansiraw.c
+++ b/com32/libutil/ansiraw.c
@@ -38,16 +38,9 @@
#include <unistd.h>
#include <console.h>
-static void __attribute__((destructor)) console_cleanup(void)
-{
- /* For the serial console, be nice and clean up */
- fputs("\033[0m\033[20l", stdout);
-}
-
void console_ansi_raw(void)
{
openconsole(&dev_rawcon_r, &dev_ansiserial_w);
- fputs("\033[0m\033[20h", stdout);
}
#else
@@ -64,7 +57,6 @@ static void __attribute__((constructor)) console_init(void)
static void __attribute__((destructor)) console_cleanup(void)
{
- fputs("\033[0m\033[20l", stdout);
tcsetattr(0, TCSANOW, &original_termios_settings);
}
@@ -83,10 +75,12 @@ void console_ansi_raw(void)
tio.c_iflag &= ~ICRNL;
tio.c_iflag |= IGNCR;
tio.c_lflag &= ~(ISIG|ICANON|ECHO);
+ if (!tio.c_oflag & OPOST)
+ tio.c_oflag = 0;
+ tio.c_oflag |= OPOST|ONLCR;
tio.c_cc[VMIN] = 0;
tio.c_cc[VTIME] = 1; /* Don't 100% busy-wait in Linux */
tcsetattr(0, TCSAFLUSH, &tio);
- fputs("\033[0m\033[20h", stdout);
}
#endif