summaryrefslogtreecommitdiffstats
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
parentee89890b4008c40bd7d6ea5ddb1016b47fee7bbf (diff)
downloadsyslinux-3.81-pre12.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>
-rw-r--r--NEWS1
-rw-r--r--com32/libutil/ansiline.c12
-rw-r--r--com32/libutil/ansiraw.c12
-rw-r--r--com32/menu/menu.c11
-rw-r--r--com32/menu/menumain.c5
-rw-r--r--com32/menu/vesamenu.c11
6 files changed, 7 insertions, 45 deletions
diff --git a/NEWS b/NEWS
index 7acd25b1..8c940b1c 100644
--- a/NEWS
+++ b/NEWS
@@ -19,6 +19,7 @@ Changes in 3.81:
has changed, so the isohybrid utility must version-match
isolinux.bin.
* Drop support for ACPI 3 extended memory flags.
+ * Menu system: don't set the autocr flag on the serial console.
Changes in 3.80:
* New shuffler mechanism and API.
diff --git a/com32/libutil/ansiline.c b/com32/libutil/ansiline.c
index 4cdac024..fffb2baa 100644
--- a/com32/libutil/ansiline.c
+++ b/com32/libutil/ansiline.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_std(void)
{
openconsole(&dev_stdcon_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,8 +75,10 @@ void console_ansi_std(void)
tio.c_iflag &= ~ICRNL;
tio.c_iflag |= IGNCR;
tio.c_lflag |= ICANON|ECHO;
+ if (!tio.c_oflag & OPOST)
+ tio.c_oflag = 0;
+ tio.c_oflag |= OPOST|ONLCR;
tcsetattr(0, TCSANOW, &tio);
- fputs("\033[0m\033[20h", stdout);
}
#endif
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
diff --git a/com32/menu/menu.c b/com32/menu/menu.c
index 9a6ad895..6d64bad0 100644
--- a/com32/menu/menu.c
+++ b/com32/menu/menu.c
@@ -20,16 +20,6 @@
#include <consoles.h>
#include "menu.h"
-void console_prepare(void)
-{
- /* Nothing special to do */
-}
-
-void console_cleanup(void)
-{
- /* Nothing special to do */
-}
-
int draw_background(const char *arg)
{
/* Nothing to do... */
@@ -40,6 +30,5 @@ int draw_background(const char *arg)
int main(int argc, char *argv[])
{
console_ansi_raw();
-
return menu_main(argc, argv);
}
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index b3131faf..81780eac 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1052,8 +1052,6 @@ int menu_main(int argc, char *argv[])
(void)argc;
- console_prepare();
-
if (getscreensize(1, &rows, &cols)) {
/* Unknown screen size? */
rows = 24;
@@ -1084,7 +1082,6 @@ int menu_main(int argc, char *argv[])
cmdline = run_menu();
printf("\033[?25h\033[%d;1H\033[0m", END_ROW);
- console_cleanup();
if ( cmdline ) {
execute(cmdline, KT_NONE);
@@ -1093,7 +1090,5 @@ int menu_main(int argc, char *argv[])
} else {
return 0; /* Exit */
}
-
- console_prepare(); /* If we're looping... */
}
}
diff --git a/com32/menu/vesamenu.c b/com32/menu/vesamenu.c
index 094b8f65..4dd45865 100644
--- a/com32/menu/vesamenu.c
+++ b/com32/menu/vesamenu.c
@@ -25,17 +25,6 @@
#include "menu.h"
-void console_prepare(void)
-{
- fputs("\033[0m\033[25l", stdout);
-}
-
-void console_cleanup(void)
-{
- /* For the serial console, be nice and clean up */
- fputs("\033[0m", stdout);
-}
-
int draw_background(const char *what)
{
if (!what)