From: Erik Andersen Date: Mon, 21 Feb 2000 19:25:12 +0000 (-0000) Subject: Minor update for handling TERM with serial consoles. X-Git-Tag: 0_43pre1~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fa4718efcf055d8720ea99be1af237a921232f5a;p=oweals%2Fbusybox.git Minor update for handling TERM with serial consoles. -Erik --- diff --git a/init.c b/init.c index a3e165ecc..4a19822ae 100644 --- a/init.c +++ b/init.c @@ -314,8 +314,10 @@ static void console_init() if (ioctl(0, TIOCGSERIAL, &sr) == 0) { log = NULL; secondConsole = NULL; - /* Force the TERM setting to vt102 for serial console */ - snprintf(termType, sizeof(termType) - 1, "TERM=vt102"); + /* Force the TERM setting to vt102 for serial console -- + * iff TERM is set to linux (the default) */ + if (strcmp( termType, "TERM=linux" ) == 0) + snprintf(termType, sizeof(termType) - 1, "TERM=vt102"); message(LOG | CONSOLE, "serial console detected. Disabling virtual terminals.\r\n"); } diff --git a/init/init.c b/init/init.c index a3e165ecc..4a19822ae 100644 --- a/init/init.c +++ b/init/init.c @@ -314,8 +314,10 @@ static void console_init() if (ioctl(0, TIOCGSERIAL, &sr) == 0) { log = NULL; secondConsole = NULL; - /* Force the TERM setting to vt102 for serial console */ - snprintf(termType, sizeof(termType) - 1, "TERM=vt102"); + /* Force the TERM setting to vt102 for serial console -- + * iff TERM is set to linux (the default) */ + if (strcmp( termType, "TERM=linux" ) == 0) + snprintf(termType, sizeof(termType) - 1, "TERM=vt102"); message(LOG | CONSOLE, "serial console detected. Disabling virtual terminals.\r\n"); }