From owner-svn-src-all@freebsd.org Mon Mar 19 15:48:32 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 0BA1AF565ED; Mon, 19 Mar 2018 15:48:32 +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 B3B7075F1A; Mon, 19 Mar 2018 15:48:31 +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 AA57810849; Mon, 19 Mar 2018 15:48:31 +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 w2JFmVkl068677; Mon, 19 Mar 2018 15:48:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2JFmVGB068675; Mon, 19 Mar 2018 15:48:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803191548.w2JFmVGB068675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 19 Mar 2018 15:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331211 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331211 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.25 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: Mon, 19 Mar 2018 15:48:32 -0000 Author: kevans Date: Mon Mar 19 15:48:31 2018 New Revision: 331211 URL: https://svnweb.freebsd.org/changeset/base/331211 Log: lualoader: Setup default color scheme if we're using colors The console may have been set for different colors before lualoader kicks in; notably, a black-on-white color scheme is not necessarily what we're expecting. While here, make color.default() a composition of color.escape() instead of rewriting the escape sequence to make it more obvious what it's achieving: a white-on-black color scheme with no attributes set. Reported by: emaste, whose eyes may rest easily Modified: head/stand/lua/color.lua head/stand/lua/loader.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Mon Mar 19 15:35:26 2018 (r331210) +++ head/stand/lua/color.lua Mon Mar 19 15:48:31 2018 (r331211) @@ -89,7 +89,7 @@ function color.default() if color.disabled then return "" end - return core.KEYSTR_CSI .. "0;37;40m" + return color.escape(color.WHITE, color.BLACK, color.DEFAULT) end function color.highlight(str) Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Mon Mar 19 15:35:26 2018 (r331210) +++ head/stand/lua/loader.lua Mon Mar 19 15:48:31 2018 (r331211) @@ -34,6 +34,7 @@ -- Other modules will also need some of the functions it defines to safely -- execute loader commands. require("cli") +local color = require("color") local core = require("core") local config = require("config") local menu @@ -49,6 +50,11 @@ if result ~= nil then end 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 color.isEnabled() then + printc(color.default()) +end password.check() -- menu might be disabled if menu ~= nil then