summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorolgeni <olgeni@FreeBSD.org>2001-06-13 10:25:09 +0000
committerolgeni <olgeni@FreeBSD.org>2001-06-13 10:25:09 +0000
commit2514663dd721b9ac234d35a4dac65dfc457ff6bc (patch)
tree985621d6760a3153faffbd7dc4ded88795ac2449 /usr.sbin
parenteaaabb7358692b5cc1f4f2871a4ea614517d80bf (diff)
downloadFreeBSD-src-2514663dd721b9ac234d35a4dac65dfc457ff6bc.zip
FreeBSD-src-2514663dd721b9ac234d35a4dac65dfc457ff6bc.tar.gz
Add terminal type configuration to the Options screen. It allows selecting
a monochrome display after booting into sysinstall, if you have any trouble with the default color scheme. Approved by: jkh MFC after: 2 weeks
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sade/sade.h1
-rw-r--r--usr.sbin/sysinstall/options.c32
-rw-r--r--usr.sbin/sysinstall/sysinstall.h1
3 files changed, 34 insertions, 0 deletions
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index 75299de..b8cf0e1 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -175,6 +175,7 @@
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"
#define VAR_XF86_CONFIG "_xf86config"
+#define VAR_TERM "TERM"
#define DEFAULT_TAPE_BLOCKSIZE "20"
diff --git a/usr.sbin/sysinstall/options.c b/usr.sbin/sysinstall/options.c
index 0be8ff7..680edf0 100644
--- a/usr.sbin/sysinstall/options.c
+++ b/usr.sbin/sysinstall/options.c
@@ -38,6 +38,7 @@
#include <ctype.h>
int fixitTtyWhich(dialogMenuItem *);
+int termSetType(dialogMenuItem *);
static char *
varCheck(Option opt)
@@ -124,6 +125,8 @@ static Option Options[] = {
OPT_IS_FUNC, mediaSetFTPUserPass, VAR_FTP_USER, varCheck },
{ "Editor", "Which text editor to use during installation",
OPT_IS_VAR, EDITOR_PROMPT, VAR_EDITOR, varCheck },
+{ "Terminal", "Set terminal type (TERMCAP)",
+ OPT_IS_FUNC, termSetType, VAR_TERM, varCheck },
{ "Tape Blocksize", "Tape media block size in 512 byte blocks",
OPT_IS_VAR, TAPE_PROMPT, VAR_TAPE_BLOCKSIZE, varCheck },
{ "Extract Detail", "How verbosely to display file name information during extractions",
@@ -333,3 +336,32 @@ fixitTtyWhich(dialogMenuItem *self)
}
return DITEM_SUCCESS;
}
+
+/* Select terminal type */
+int
+termSetType(dialogMenuItem *self)
+{
+ char *cp = variable_get(VAR_TERM);
+
+ if (!cp) {
+ msgConfirm("TERMCAP is not set to anything!");
+ return DITEM_FAILURE;
+ }
+ else {
+ if (!strcmp(cp, "ansi"))
+ variable_set2(VAR_TERM, "vt100", 0);
+ else if (!strcmp(cp, "vt100"))
+ variable_set2(VAR_TERM, "cons25w", 0);
+ else if (!strcmp(cp, "cons25w"))
+ variable_set2(VAR_TERM, "cons25", 0);
+ else if (!strcmp(cp, "cons25"))
+ variable_set2(VAR_TERM, "cons25-m", 0);
+ else if (!strcmp(cp, "cons25-m"))
+ variable_set2(VAR_TERM, "xterm", 0);
+ else /* must be "high" - wrap around */
+ variable_set2(VAR_TERM, "ansi", 0);
+ }
+
+ setterm (cp);
+ return DITEM_SUCCESS;
+}
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index 75299de..b8cf0e1 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -175,6 +175,7 @@
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"
#define VAR_XF86_CONFIG "_xf86config"
+#define VAR_TERM "TERM"
#define DEFAULT_TAPE_BLOCKSIZE "20"
OpenPOWER on IntegriCloud