Page MenuHomeFreeBSD

D4968.diff
No OneTemporary

D4968.diff

Index: head/usr.sbin/vidcontrol/vidcontrol.1
===================================================================
--- head/usr.sbin/vidcontrol/vidcontrol.1
+++ head/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 @@
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 @@
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.
Index: head/usr.sbin/vidcontrol/vidcontrol.c
===================================================================
--- head/usr.sbin/vidcontrol/vidcontrol.c
+++ head/usr.sbin/vidcontrol/vidcontrol.c
@@ -198,7 +198,7 @@
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 @@
/*
+ * 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 @@
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");
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 4:00 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15531479
Default Alt Text
D4968.diff (2 KB)

Event Timeline