diff options
Diffstat (limited to 'usr.sbin/vidcontrol')
-rw-r--r-- | usr.sbin/vidcontrol/vidcontrol.1 | 8 | ||||
-rw-r--r-- | usr.sbin/vidcontrol/vidcontrol.c | 24 |
2 files changed, 29 insertions, 3 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.1 b/usr.sbin/vidcontrol/vidcontrol.1 index 332643c..0fca733 100644 --- a/usr.sbin/vidcontrol/vidcontrol.1 +++ b/usr.sbin/vidcontrol/vidcontrol.1 @@ -13,7 +13,7 @@ .\" @(#)vidcontrol.1 .\" $FreeBSD$ .\" -.Dd May 27, 2001 +.Dd May 27, 2002 .Dt VIDCONTROL 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Op Fl M Ar char .Op Fl m Cm on | off .Op Fl r Ar foreground Ar background +.Op Fl S Cm on | off .Op Fl s Ar number .Op Fl t Ar N | Cm off .Op Ar mode @@ -213,6 +214,11 @@ Change reverse mode colors to .Ar foreground and .Ar background . +.It Fl S Cm on | off +Turn vty switching on or off. +When vty switching is off, +attempts to switch to a different virtual terminal will fail. +(The default is to permit vty switching.) .It Fl s Ar number Set the current vty to .Ar number . diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c index 3bc73d1..5f0d018 100644 --- a/usr.sbin/vidcontrol/vidcontrol.c +++ b/usr.sbin/vidcontrol/vidcontrol.c @@ -76,7 +76,7 @@ usage() "usage: vidcontrol [-CdLPpx] [-b color] [-c appearance] [-f [size] file]", " [-g geometry] [-h size] [-i adapter | mode] [-l screen_map]", " [-m on | off] [-M char] [-r foreground background] [-s num]", -" [-t N | off] [mode] [foreground [background]] [show]"); +" [-S on | off] [-t N | off] [mode] [foreground [background]] [show]"); exit(1); } @@ -518,6 +518,23 @@ set_mouse(char *arg) ioctl(0, CONS_MOUSECTL, &mouse); } +void +set_lockswitch(char *arg) +{ + int data; + + if (!strcmp(arg, "off")) + data = 0x01; + else if (!strcmp(arg, "on")) + data = 0x02; + else { + warnx("argument to -S must either on or off"); + return; + } + if (ioctl(0, VT_LOCKSWITCH, &data) == -1) + warn("ioctl(VT_LOCKSWITCH)"); +} + static char *adapter_name(int type) { @@ -749,7 +766,7 @@ main(int argc, char **argv) /* Not reached */ if (ioctl(0, CONS_GETINFO, &info) < 0) err(1, "must be on a virtual console"); - while((opt = getopt(argc, argv, "b:Cc:df:g:h:i:l:LM:m:pPr:s:t:x")) != -1) + while((opt = getopt(argc, argv, "b:Cc:df:g:h:i:l:LM:m:pPr:S:s:t:x")) != -1) switch(opt) { case 'b': set_border_color(optarg); @@ -806,6 +823,9 @@ main(int argc, char **argv) case 'r': set_reverse_colors(argc, argv, &optind); break; + case 'S': + set_lockswitch(optarg); + break; case 's': set_console(optarg); break; |