loader: vidconsole should set LINES and COLUMNS

Set LINES and COLUMNS based on terminal dimensions.
This commit is contained in:
Toomas Soome 2019-09-10 21:53:42 +00:00
parent 90a2541772
commit e7da26b6ca
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=352195
2 changed files with 6 additions and 1 deletions

View File

@ -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 = ' ';

View File

@ -238,7 +238,6 @@ main(void)
printf("\n%s", bootprog_info);
extract_currdev(); /* set $currdev and $loaddev */
setenv("LINES", "24", 1); /* optional */
bios_getsmap();