svn commit: r238158 - stable/9/usr.sbin/vidcontrol
Andrey A. Chernov
ache at FreeBSD.org
Fri Jul 6 01:32:54 UTC 2012
Author: ache
Date: Fri Jul 6 01:32:53 2012
New Revision: 238158
URL: http://svn.freebsd.org/changeset/base/238158
Log:
MFC r237777
Call set_terminal_mode() after video mode change, not before, because
video mode change always reset terminal mode to xterm.
It allows things like 'vidcontrol -T cons25 80x30' works as supposed,
and allows 'allscreens_flags="-T cons25 80x30"' in /etc/rc.conf too.
Approved by: re (hrs)
Modified:
stable/9/usr.sbin/vidcontrol/vidcontrol.c
Directory Properties:
stable/9/usr.sbin/vidcontrol/ (props changed)
Modified: stable/9/usr.sbin/vidcontrol/vidcontrol.c
==============================================================================
--- stable/9/usr.sbin/vidcontrol/vidcontrol.c Fri Jul 6 00:58:27 2012 (r238157)
+++ stable/9/usr.sbin/vidcontrol/vidcontrol.c Fri Jul 6 01:32:53 2012 (r238158)
@@ -1194,15 +1194,13 @@ set_terminal_mode(char *arg)
fprintf(stderr, "\033[=T");
else if (strcmp(arg, "cons25") == 0)
fprintf(stderr, "\033[=1T");
- else
- usage();
}
int
main(int argc, char **argv)
{
- char *font, *type;
+ char *font, *type, *termmode;
int dumpmod, dumpopt, opt;
int reterr;
@@ -1214,6 +1212,7 @@ main(int argc, char **argv)
err(1, "must be on a virtual console");
dumpmod = 0;
dumpopt = DUMP_FBF;
+ termmode = NULL;
while ((opt = getopt(argc, argv,
"b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
switch(opt) {
@@ -1285,7 +1284,10 @@ main(int argc, char **argv)
set_console(optarg);
break;
case 'T':
- set_terminal_mode(optarg);
+ if (strcmp(optarg, "xterm") != 0 &&
+ strcmp(optarg, "cons25") != 0)
+ usage();
+ termmode = optarg;
break;
case 't':
set_screensaver_timeout(optarg);
@@ -1308,6 +1310,8 @@ main(int argc, char **argv)
}
video_mode(argc, argv, &optind);
+ if (termmode != NULL)
+ set_terminal_mode(termmode);
get_normal_colors(argc, argv, &optind);
More information about the svn-src-stable-9
mailing list