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();
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to