Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Jun 2018 03:44:34 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r334986 - head/stand/lua
Message-ID:  <201806120344.w5C3iYYJ098283@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806120344.w5C3iYYJ098283>