summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2016-01-19 13:09:20 +0000
committertrasz <trasz@FreeBSD.org>2016-01-19 13:09:20 +0000
commit06259ebaf8ff60d868938e8ef5c4304d4a9c4243 (patch)
treec22e8ee07027059f4cbfd76e0319f2bbe80a508c /usr.sbin
parenta5f4b9478d37848cb30b99ef4a000aa29e01be69 (diff)
downloadFreeBSD-src-06259ebaf8ff60d868938e8ef5c4304d4a9c4243.zip
FreeBSD-src-06259ebaf8ff60d868938e8ef5c4304d4a9c4243.tar.gz
Add "vidcontrol -i active", to print out active vty number,
to be used with eg "vidcontrol -s". Reviewed by: emaste@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4968
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.18
-rw-r--r--usr.sbin/vidcontrol/vidcontrol.c21
2 files changed, 23 insertions, 6 deletions
diff --git a/usr.sbin/vidcontrol/vidcontrol.1 b/usr.sbin/vidcontrol/vidcontrol.1
index d722628..acec0ae 100644
--- a/usr.sbin/vidcontrol/vidcontrol.1
+++ b/usr.sbin/vidcontrol/vidcontrol.1
@@ -13,7 +13,7 @@
.\" @(#)vidcontrol.1
.\" $FreeBSD$
.\"
-.Dd December 23, 2006
+.Dd January 19, 2016
.Dt VIDCONTROL 1
.Os
.Sh NAME
@@ -33,7 +33,7 @@
.Oc
.Op Fl g Ar geometry
.Op Fl h Ar size
-.Op Fl i Cm adapter | mode
+.Op Fl i Cm active | adapter | mode
.Op Fl l Ar screen_map
.Op Fl M Ar char
.Op Fl m Cm on | off
@@ -198,6 +198,8 @@ below.
Set the size of the history (scrollback) buffer to
.Ar size
lines.
+.It Fl i Cm active
+Shows the active vty number.
.It Fl i Cm adapter
Shows info about the current video adapter.
.It Fl i Cm mode
@@ -266,7 +268,7 @@ option.
However, you probably should not compile the kernel debugger on a box which
is supposed to be physically secure.
.It Fl s Ar number
-Set the current vty to
+Set the active vty to
.Ar number .
.It Fl T Cm xterm | cons25
Switch between xterm and cons25 style terminal emulation.
diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index cbf8f47..1dba9cb 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -198,7 +198,7 @@ usage(void)
if (vt4_mode)
fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n",
"usage: vidcontrol [-CHPpx] [-b color] [-c appearance] [-f [[size] file]]",
-" [-g geometry] [-h size] [-i adapter | mode]",
+" [-g geometry] [-h size] [-i active | adapter | mode]",
" [-M char] [-m on | off] [-r foreground background]",
" [-S on | off] [-s number] [-T xterm | cons25] [-t N | off]",
" [mode] [foreground [background]] [show]");
@@ -1035,6 +1035,18 @@ static const char
/*
+ * Show active VTY, ie current console number.
+ */
+
+static void
+show_active_info(void)
+{
+
+ printf("%d\n", cur_info.active_vty);
+}
+
+
+/*
* Show graphics adapter information.
*/
@@ -1153,13 +1165,16 @@ show_mode_info(void)
static void
show_info(char *arg)
{
- if (!strcmp(arg, "adapter")) {
+
+ if (!strcmp(arg, "active")) {
+ show_active_info();
+ } else if (!strcmp(arg, "adapter")) {
show_adapter_info();
} else if (!strcmp(arg, "mode")) {
show_mode_info();
} else {
revert();
- errx(1, "argument to -i must be either adapter or mode");
+ errx(1, "argument to -i must be active, adapter, or mode");
}
}
OpenPOWER on IntegriCloud