From owner-freebsd-bugs Sat Jun 10 20:30: 8 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id D78DC37BA00 for ; Sat, 10 Jun 2000 20:30:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id UAA91200; Sat, 10 Jun 2000 20:30:00 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from teapot.egroups.net (teapot.egroups.net [63.204.207.250]) by hub.freebsd.org (Postfix) with SMTP id 453EE37B564 for ; Sat, 10 Jun 2000 20:20:01 -0700 (PDT) (envelope-from kbyanc@teapot.egroups.com) Received: (qmail 31856 invoked from network); 11 Jun 2000 03:20:08 -0000 Received: (QMFILT: 1.0); 11 Jun 2000 04:20:08 -0000 Received: from dhcp147.corp.onelist.com (HELO kbyanc.corp.ONElist.com) (192.168.10.147) by teapot.egroups.net with SMTP; 11 Jun 2000 03:20:08 -0000 Received: (from kbyanc@localhost) by kbyanc.corp.ONElist.com (8.9.3/8.9.3) id UAA91705; Sat, 10 Jun 2000 20:20:00 -0700 (PDT) (envelope-from kbyanc@teapot.egroups.com) Message-Id: <200006110320.UAA91705@kbyanc.corp.ONElist.com> Date: Sat, 10 Jun 2000 20:20:00 -0700 (PDT) From: kbyanc@posi.net Reply-To: kbyanc@posi.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/19190: patch to set history buffer size via vidcontrol(1) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >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