svn commit: r360599 - in stable/11/stand: forth lua

Kyle Evans kevans at FreeBSD.org
Sun May 3 04:03:07 UTC 2020


Author: kevans
Date: Sun May  3 04:03:05 2020
New Revision: 360599
URL: https://svnweb.freebsd.org/changeset/base/360599

Log:
  MFC r359371: loader: Fully reset terminal settings, not just colors

Modified:
  stable/11/stand/forth/loader.4th
  stable/11/stand/forth/loader.rc
  stable/11/stand/forth/screen.4th
  stable/11/stand/lua/core.lua
  stable/11/stand/lua/loader.lua
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/forth/loader.4th
==============================================================================
--- stable/11/stand/forth/loader.4th	Sun May  3 03:56:17 2020	(r360598)
+++ stable/11/stand/forth/loader.4th	Sun May  3 04:03:05 2020	(r360599)
@@ -49,6 +49,12 @@ include /boot/check-password.4th
 
 only forth definitions
 
+: maybe-resetcons ( -- )
+  loader_color? if
+    ris
+  then
+;
+
 : bootmsg ( -- )
   loader_color? dup ( -- bool bool )
   if 7 fg 4 bg then

Modified: stable/11/stand/forth/loader.rc
==============================================================================
--- stable/11/stand/forth/loader.rc	Sun May  3 03:56:17 2020	(r360598)
+++ stable/11/stand/forth/loader.rc	Sun May  3 04:03:05 2020	(r360599)
@@ -12,6 +12,8 @@ try-include /boot/loader.rc.local
 \ NOTE: Change to `initialize' if you enable the below boot menu
 start
 
+maybe-resetcons
+
 \ Tests for password -- executes autoboot first if a password was defined
 check-password
 

Modified: stable/11/stand/forth/screen.4th
==============================================================================
--- stable/11/stand/forth/screen.4th	Sun May  3 03:56:17 2020	(r360598)
+++ stable/11/stand/forth/screen.4th	Sun May  3 04:03:05 2020	(r360599)
@@ -39,6 +39,9 @@ marker task-screen.4th
 \ clear screen
 : clear ( -- ) ho cld ;
 
+\ reset to initial state
+: ris ( -- ) 27 emit [char] c emit ;
+
 \ move cursor to x rows, y cols (1-based coords) ( Esc-[%d;%dH )
 : at-xy ( x y -- ) escc .# [char] ; emit .# [char] H emit ;
 

Modified: stable/11/stand/lua/core.lua
==============================================================================
--- stable/11/stand/lua/core.lua	Sun May  3 03:56:17 2020	(r360598)
+++ stable/11/stand/lua/core.lua	Sun May  3 04:03:05 2020	(r360599)
@@ -103,6 +103,7 @@ core.KEY_DELETE		= 127
 -- other contexts (outside of Lua) may mean 'octal'
 core.KEYSTR_ESCAPE	= "\027"
 core.KEYSTR_CSI		= core.KEYSTR_ESCAPE .. "["
+core.KEYSTR_RESET	= core.KEYSTR_ESCAPE .. "c"
 
 core.MENU_RETURN	= "return"
 core.MENU_ENTRY		= "entry"

Modified: stable/11/stand/lua/loader.lua
==============================================================================
--- stable/11/stand/lua/loader.lua	Sun May  3 03:56:17 2020	(r360598)
+++ stable/11/stand/lua/loader.lua	Sun May  3 04:03:05 2020	(r360599)
@@ -38,25 +38,21 @@ local color = require("color")
 local core = require("core")
 local config = require("config")
 local password = require("password")
--- The menu module will be brought in after config has loaded if we actually
--- need it.
-local menu
 
 config.load()
 
--- Our console may have been setup for a different color scheme before we get
--- here, so make sure we set the default.
+if core.isUEFIBoot() then
+	loader.perform("efi-autoresizecons")
+end
+-- Our console may have been setup with different settings before we get
+-- here, so make sure we reset everything back to default.
 if color.isEnabled() then
-	printc(color.default())
+	printc(core.KEYSTR_RESET)
 end
 try_include("local")
-if not core.isMenuSkipped() then
-	menu = require("menu")
-end
 password.check()
--- menu might be disabled
-if menu ~= nil then
-	menu.run()
+if not core.isMenuSkipped() then
+	require("menu").run()
 else
 	-- Load kernel/modules before we go
 	config.loadelf()


More information about the svn-src-stable mailing list