From 05d53ab3a72fad10e4cd054385a989463c149d09 Mon Sep 17 00:00:00 2001 From: jkh Date: Thu, 18 May 1995 15:29:47 +0000 Subject: 1. Use 8x16 fonts. 2. Don't use russian screenmap - apparently not necessary with right font. 3. Dequote bogusly quoted font name in english language setting. 4. Use setterm() and hack around an undesirable side-effect (cbreak is unset). 5. be smarter about setting OnVTY, and use it in cases where it makes sense. Submitted by: Nickolay N. Dudorov --- usr.sbin/sysinstall/termcap.c | 47 ++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-) (limited to 'usr.sbin/sysinstall/termcap.c') diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c index 86e758a..2cd8158 100644 --- a/usr.sbin/sysinstall/termcap.c +++ b/usr.sbin/sysinstall/termcap.c @@ -26,35 +26,44 @@ int set_termcap(void) { char *term; + int stat; OnVTY = OnSerial = FALSE; + if (getpid() != 1) + DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); term = getenv("TERM"); - if (term == NULL) { - if (ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay) < 0) { + stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay); + if (stat < 0) { + if (!term) { if (setenv("TERM", "vt100", 1) < 0) return -1; if (setenv("TERMCAP", termcap_vt100, 1) < 0) return -1; - DebugFD = dup(1); - OnSerial = TRUE; - } else if (ColorDisplay) { - if (setenv("TERM", "cons25", 1) < 0) - return -1; - if (setenv("TERMCAP", termcap_cons25, 1) < 0) - return -1; - DebugFD = open("/dev/ttyv1", O_WRONLY); - OnVTY = TRUE; - } else { - if (setenv("TERM", "cons25-m", 1) < 0) - return -1; - if (setenv("TERMCAP", termcap_cons25_m, 1) < 0) - return -1; - DebugFD = open("/dev/ttyv1", O_WRONLY); - OnVTY = TRUE; } + if (DebugFD == -1) + DebugFD = dup(1); + OnSerial = TRUE; } else { - DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644); + if (ColorDisplay) { + if (!term) { + if (setenv("TERM", "cons25", 1) < 0) + return -1; + if (setenv("TERMCAP", termcap_cons25, 1) < 0) + return -1; + } + } + else { + if (!term) { + if (setenv("TERM", "cons25-m", 1) < 0) + return -1; + if (setenv("TERMCAP", termcap_cons25_m, 1) < 0) + return -1; + } + } + if (DebugFD == -1) + DebugFD = open("/dev/ttyv1", O_WRONLY); + OnVTY = TRUE; } return 0; } -- cgit v1.1