Date: Tue, 10 Sep 2019 21:53:43 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r352195 - in head/stand/i386: libi386 loader Message-ID: <201909102153.x8ALrhPU012273@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Tue Sep 10 21:53:42 2019 New Revision: 352195 URL: https://svnweb.freebsd.org/changeset/base/352195 Log: loader: vidconsole should set LINES and COLUMNS Set LINES and COLUMNS based on terminal dimensions. Modified: head/stand/i386/libi386/vidconsole.c head/stand/i386/loader/main.c Modified: head/stand/i386/libi386/vidconsole.c ============================================================================== --- head/stand/i386/libi386/vidconsole.c Tue Sep 10 21:30:38 2019 (r352194) +++ head/stand/i386/libi386/vidconsole.c Tue Sep 10 21:53:42 2019 (r352195) @@ -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); @@ -605,6 +606,11 @@ vidc_init(int arg) teken_init(&teken, &tf, NULL); 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++) { Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Tue Sep 10 21:30:38 2019 (r352194) +++ head/stand/i386/loader/main.c Tue Sep 10 21:53:42 2019 (r352195) @@ -238,7 +238,6 @@ main(void) printf("\n%s", bootprog_info); extract_currdev(); /* set $currdev and $loaddev */ - setenv("LINES", "24", 1); /* optional */ bios_getsmap();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909102153.x8ALrhPU012273>