loader: vidconsole should set LINES and COLUMNS
Set LINES and COLUMNS based on terminal dimensions.
This commit is contained in:
parent
d03c822884
commit
d3ea9b4160
@ -574,6 +574,7 @@ vidc_init(int arg)
|
|||||||
{
|
{
|
||||||
const teken_attr_t *a;
|
const teken_attr_t *a;
|
||||||
int val;
|
int val;
|
||||||
|
char env[8];
|
||||||
|
|
||||||
if (vidc_started && arg == 0)
|
if (vidc_started && arg == 0)
|
||||||
return (0);
|
return (0);
|
||||||
@ -606,6 +607,11 @@ vidc_init(int arg)
|
|||||||
teken_set_winsize(&teken, &tp);
|
teken_set_winsize(&teken, &tp);
|
||||||
a = teken_get_defattr(&teken);
|
a = teken_get_defattr(&teken);
|
||||||
|
|
||||||
|
snprintf(env, sizeof (env), "%u", tp.tp_row);
|
||||||
|
setenv("LINES", env, 1);
|
||||||
|
snprintf(env, sizeof (env), "%u", tp.tp_col);
|
||||||
|
setenv("COLUMNS", env, 1);
|
||||||
|
|
||||||
for (int row = 0; row < tp.tp_row; row++)
|
for (int row = 0; row < tp.tp_row; row++)
|
||||||
for (int col = 0; col < tp.tp_col; col++) {
|
for (int col = 0; col < tp.tp_col; col++) {
|
||||||
buffer[col + row * tp.tp_col].c = ' ';
|
buffer[col + row * tp.tp_col].c = ' ';
|
||||||
|
@ -238,7 +238,6 @@ main(void)
|
|||||||
printf("\n%s", bootprog_info);
|
printf("\n%s", bootprog_info);
|
||||||
|
|
||||||
extract_currdev(); /* set $currdev and $loaddev */
|
extract_currdev(); /* set $currdev and $loaddev */
|
||||||
setenv("LINES", "24", 1); /* optional */
|
|
||||||
|
|
||||||
bios_getsmap();
|
bios_getsmap();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user