Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jun 2000 20:20:00 -0700 (PDT)
From:      kbyanc@posi.net
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/19190: patch to set history buffer size via vidcontrol(1)
Message-ID:  <200006110320.UAA91705@kbyanc.corp.ONElist.com>

next in thread | raw e-mail | index | archive | help

>Number:         19190
>Category:       bin
>Synopsis:       patch to set history buffer size via vidcontrol(1)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 10 20:30:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Kelly Yancey
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
eGroups.com -- http://www.eGroups.com/
>Environment:

FreeBSD backroom.corp.ONElist.com 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Sat
Jun 10 12:08:26 PDT 2000
kbyanc@backroom.corp.ONElist.com:/usr/src/sys/compile/BACKROOM  i386

>Description:

	This patch teaches vidcontrol(1) about the CONS_HISTORY ioctl for
	syscons. It adds a -h parameter to allow the user to set the
	size of the history scrollback buffer in lines. It also updates
	the man page to briefly describe the new option.

	-Kelly
	 kbyanc@posi.net

>How-To-Repeat:
>Fix:

Index: vidcontrol.1
===================================================================
RCS file: /home/cvs/src/usr.sbin/vidcontrol/vidcontrol.1,v
retrieving revision 1.24
diff -u -r1.24 vidcontrol.1
--- vidcontrol.1	2000/03/01 14:07:45	1.24
+++ vidcontrol.1	2000/06/10 21:18:13
@@ -26,6 +26,7 @@
 .Op Fl c Ar appearance
 .Op Fl d
 .Op Fl f Ar size Ar file
+.Op Fl h Ar lines
 .Op Fl i Cm adapter | mode
 .Op Fl l Ar screen_map
 .Op Fl L
@@ -137,6 +138,9 @@
 Used together with the 
 .Xr moused 8
 daemon for text mode cut & paste functionality.
+.It Fl h Ar lines
+Set the history buffer to
+.Ar lines .
 .It Fl f Ar size Ar file
 Load font
 .Ar file
Index: vidcontrol.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/vidcontrol/vidcontrol.c,v
retrieving revision 1.32
diff -u -r1.32 vidcontrol.c
--- vidcontrol.c	2000/01/12 12:30:33	1.32
+++ vidcontrol.c	2000/06/10 20:47:07
@@ -61,8 +61,8 @@
 	fprintf(stderr, "%s\n%s\n%s\n%s\n",
 "usage: vidcontrol [-r fg bg] [-b color] [-c appearance] [-d] [-l scrmap]",
 "                  [-i adapter | mode] [-L] [-M char] [-m on|off]",
-"                  [-f size file] [-s number] [-t N|off] [-x] [mode]",
-"                  [fgcol [bgcol]] [show]");
+"                  [-h lines] [-f size file] [-s number] [-t N|off] [-x]",
+"                  [mode] [fgcol [bgcol]] [show]");
 	exit(1);
 }
 
@@ -547,6 +547,20 @@
 }
 
 void
+set_history_size(char *arg)
+{
+	int l;
+
+	l = (int)strtol(arg, NULL, 0);
+	if (l < 0) {
+		warnx("argument to -h must be greater than 0");
+		return;
+	}
+	if (ioctl(0, CONS_HISTORY, &l) < 0)
+		warn("cannot set history size");
+}
+
+void
 test_frame()
 {
 	int i;
@@ -573,7 +587,7 @@
 	info.size = sizeof(info);
 	if (ioctl(0, CONS_GETINFO, &info) < 0)
 		err(1, "must be on a virtual console");
-	while((opt = getopt(argc, argv, "b:c:df:i:l:LM:m:r:s:t:x")) != -1)
+	while((opt = getopt(argc, argv, "b:c:df:h:i:l:LM:m:r:s:t:x")) != -1)
 		switch(opt) {
 			case 'b':
 				set_border_color(optarg);
@@ -587,6 +601,9 @@
 			case 'f':
 				load_font(optarg,
 					nextarg(argc, argv, &optind, 'f'));
+				break;
+			case 'h':
+				set_history_size(optarg);
 				break;
 			case 'i':
 				show_info(optarg);

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006110320.UAA91705>