svn commit: r334986 - head/stand/lua

Kyle Evans kevans at FreeBSD.org
Tue Jun 12 03:44:35 UTC 2018


Author: kevans
Date: Tue Jun 12 03:44:34 2018
New Revision: 334986
URL: https://svnweb.freebsd.org/changeset/base/334986

Log:
  lualoader: More black-on-white fixes
  
  To recap the problem: with a black-on-white xterm, the menu draws terribly.
  Ideally, we would try our best for a white-on-black context for the menu
  since graphics and whatnot might not be tested for other setups and there's
  no reasonable way to sample the terminal at this point for the used color
  scheme.
  
  This commit attempts to address that further in two ways:
  - Instead of issuing CSI bg/fg resets (CSI 39m and CSI 49m respectively for
    "default"), issue CSI bg/fg escape sequences for our expected color scheme
  - Reset to *our* default color scheme before we even attempt to load the
    local module, so that we personally don't have any earlier text with the
    console default color scheme.
  
  Reported by:	emaste (again)

Modified:
  head/stand/lua/color.lua
  head/stand/lua/loader.lua

Modified: head/stand/lua/color.lua
==============================================================================
--- head/stand/lua/color.lua	Tue Jun 12 01:50:58 2018	(r334985)
+++ head/stand/lua/color.lua	Tue Jun 12 03:44:34 2018	(r334986)
@@ -69,7 +69,7 @@ function color.resetfg()
 	if color.disabled then
 		return ''
 	end
-	return core.KEYSTR_CSI .. "39m"
+	return color.escapefg(color.WHITE)
 end
 
 function color.escapebg(color_value)
@@ -83,7 +83,7 @@ function color.resetbg()
 	if color.disabled then
 		return ''
 	end
-	return core.KEYSTR_CSI .. "49m"
+	return color.escapebg(color.BLACK)
 end
 
 function color.escape(fg_color, bg_color, attribute)

Modified: head/stand/lua/loader.lua
==============================================================================
--- head/stand/lua/loader.lua	Tue Jun 12 01:50:58 2018	(r334985)
+++ head/stand/lua/loader.lua	Tue Jun 12 03:44:34 2018	(r334986)
@@ -42,6 +42,12 @@ local password = require("password")
 -- need it.
 local menu
 
+-- Our console may have been setup for a different color scheme before we get
+-- here, so make sure we set the default.
+if color.isEnabled() then
+	printc(color.default())
+end
+
 try_include("local")
 
 config.load()
@@ -50,11 +56,6 @@ if not core.isMenuSkipped() then
 end
 if core.isUEFIBoot() then
 	loader.perform("efi-autoresizecons")
-end
--- Our console may have been setup for a different color scheme before we get
--- here, so make sure we set the default.
-if color.isEnabled() then
-	printc(color.default())
 end
 password.check()
 -- menu might be disabled


More information about the svn-src-all mailing list