diff --git a/stand/i386/libi386/vidconsole.c b/stand/i386/libi386/vidconsole.c index 854a7f16e4cc..e947d274e89a 100644 --- a/stand/i386/libi386/vidconsole.c +++ b/stand/i386/libi386/vidconsole.c @@ -574,6 +574,7 @@ vidc_init(int arg) { const teken_attr_t *a; int val; + char env[8]; if (vidc_started && arg == 0) return (0); @@ -606,6 +607,11 @@ vidc_init(int arg) teken_set_winsize(&teken, &tp); 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 col = 0; col < tp.tp_col; col++) { buffer[col + row * tp.tp_col].c = ' '; diff --git a/stand/i386/loader/main.c b/stand/i386/loader/main.c index a7d1e82fd488..b988ebaf9e4e 100644 --- a/stand/i386/loader/main.c +++ b/stand/i386/loader/main.c @@ -238,7 +238,6 @@ main(void) printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ - setenv("LINES", "24", 1); /* optional */ bios_getsmap();