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. MFC after: 1 week
This commit is contained in:
parent
f724c6a137
commit
436f647402
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=237777
@ -1192,15 +1192,13 @@ set_terminal_mode(char *arg)
|
|||||||
fprintf(stderr, "\033[=T");
|
fprintf(stderr, "\033[=T");
|
||||||
else if (strcmp(arg, "cons25") == 0)
|
else if (strcmp(arg, "cons25") == 0)
|
||||||
fprintf(stderr, "\033[=1T");
|
fprintf(stderr, "\033[=1T");
|
||||||
else
|
|
||||||
usage();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
char *font, *type;
|
char *font, *type, *termmode;
|
||||||
int dumpmod, dumpopt, opt;
|
int dumpmod, dumpopt, opt;
|
||||||
int reterr;
|
int reterr;
|
||||||
|
|
||||||
@ -1212,6 +1210,7 @@ main(int argc, char **argv)
|
|||||||
err(1, "must be on a virtual console");
|
err(1, "must be on a virtual console");
|
||||||
dumpmod = 0;
|
dumpmod = 0;
|
||||||
dumpopt = DUMP_FBF;
|
dumpopt = DUMP_FBF;
|
||||||
|
termmode = NULL;
|
||||||
while ((opt = getopt(argc, argv,
|
while ((opt = getopt(argc, argv,
|
||||||
"b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
|
"b:Cc:df:g:h:Hi:l:LM:m:pPr:S:s:T:t:x")) != -1)
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
@ -1283,7 +1282,10 @@ main(int argc, char **argv)
|
|||||||
set_console(optarg);
|
set_console(optarg);
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
set_terminal_mode(optarg);
|
if (strcmp(optarg, "xterm") != 0 &&
|
||||||
|
strcmp(optarg, "cons25") != 0)
|
||||||
|
usage();
|
||||||
|
termmode = optarg;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
set_screensaver_timeout(optarg);
|
set_screensaver_timeout(optarg);
|
||||||
@ -1306,6 +1308,8 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
video_mode(argc, argv, &optind);
|
video_mode(argc, argv, &optind);
|
||||||
|
if (termmode != NULL)
|
||||||
|
set_terminal_mode(termmode);
|
||||||
|
|
||||||
get_normal_colors(argc, argv, &optind);
|
get_normal_colors(argc, argv, &optind);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user