diff --git a/usr.sbin/vidcontrol/vidcontrol.1 b/usr.sbin/vidcontrol/vidcontrol.1 index 2abaa1e19972..cb545eeda92f 100644 --- a/usr.sbin/vidcontrol/vidcontrol.1 +++ b/usr.sbin/vidcontrol/vidcontrol.1 @@ -38,6 +38,7 @@ .Op Fl r Ar foreground Ar background .Op Fl S Cm on | off .Op Fl s Ar number +.Op Fl T Cm xterm | cons25 .Op Fl t Ar N | Cm off .Op Ar mode .Op Ar foreground Op Ar background @@ -243,6 +244,8 @@ is supposed to be physically secure. .It Fl s Ar number Set the current vty to .Ar number . +.It Fl T Cm xterm | cons25 +Switch between xterm and cons25 style terminal emulation. .It Fl t Ar N | Cm off Set the screensaver timeout to .Ar N diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c index 847ff3e6e23e..06afe53e019e 100644 --- a/usr.sbin/vidcontrol/vidcontrol.c +++ b/usr.sbin/vidcontrol/vidcontrol.c @@ -185,8 +185,8 @@ usage(void) "usage: vidcontrol [-CdHLPpx] [-b color] [-c appearance] [-f [size] file]", " [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]", " [-M char] [-m on | off] [-r foreground background]", -" [-S on | off] [-s number] [-t N | off] [mode]", -" [foreground [background]] [show]"); +" [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]", +" [mode] [foreground [background]] [show]"); exit(1); } @@ -1159,6 +1159,18 @@ clear_history(void) } } +static void +set_terminal_mode(char *arg) +{ + + if (strcmp(arg, "xterm") == 0) + fprintf(stderr, "\033[=T"); + else if (strcmp(arg, "cons25") == 0) + fprintf(stderr, "\033[=1T"); + else + usage(); +} + int main(int argc, char **argv) @@ -1175,7 +1187,8 @@ main(int argc, char **argv) err(1, "must be on a virtual console"); dumpmod = 0; dumpopt = DUMP_FBF; - while((opt = getopt(argc, argv, "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:t:x")) != -1) + while ((opt = getopt(argc, argv, + "b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1) switch(opt) { case 'b': set_border_color(optarg); @@ -1244,6 +1257,9 @@ main(int argc, char **argv) case 's': set_console(optarg); break; + case 'T': + set_terminal_mode(optarg); + break; case 't': set_screensaver_timeout(optarg); break;