From owner-svn-src-all@freebsd.org Tue Jun 12 03:44:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F708100ECA0; Tue, 12 Jun 2018 03:44:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0FE4F69B97; Tue, 12 Jun 2018 03:44:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E49332501C; Tue, 12 Jun 2018 03:44:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5C3iYet098285; Tue, 12 Jun 2018 03:44:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5C3iYYJ098283; Tue, 12 Jun 2018 03:44:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806120344.w5C3iYYJ098283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 12 Jun 2018 03:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r334986 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 334986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 03:44:35 -0000 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