From owner-svn-src-all@freebsd.org Tue Mar 20 20:26:25 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 86F88F6BA4A; Tue, 20 Mar 2018 20:26:25 +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 3C1A585E6B; Tue, 20 Mar 2018 20:26:25 +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 1C65021808; Tue, 20 Mar 2018 20:26:25 +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 w2KKQOGZ036473; Tue, 20 Mar 2018 20:26:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2KKQOP2036471; Tue, 20 Mar 2018 20:26:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803202026.w2KKQOP2036471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 20 Mar 2018 20:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331259 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331259 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: Tue, 20 Mar 2018 20:26:25 -0000 Author: kevans Date: Tue Mar 20 20:26:24 2018 New Revision: 331259 URL: https://svnweb.freebsd.org/changeset/base/331259 Log: lualoader: Use less atomic options for resetting colors/attributes Noted by dteske: CSI 1m ... CSI 22m CSI 2m ... CSI 22m CSI 4m ... CSI 24m CSI 5m ... CSI 25m CSI 7m ... CSI 27m CSI 8m ... CSI 28m CSI (30-37)m ... CSI 39m CSI (40-47)m ... CSI 49m - Provide resetf/resetb to match escapef/escapeb - Use CSI 22m to undo a bold This is a more reasonable approach than what was previously taken. Reported by: dteske Modified: head/stand/lua/color.lua head/stand/lua/menu.lua Modified: head/stand/lua/color.lua ============================================================================== --- head/stand/lua/color.lua Tue Mar 20 20:20:49 2018 (r331258) +++ head/stand/lua/color.lua Tue Mar 20 20:26:24 2018 (r331259) @@ -65,6 +65,13 @@ function color.escapef(color_value) return core.KEYSTR_CSI .. "3" .. color_value .. "m" end +function color.resetf() + if color.disabled then + return '' + end + return core.KEYSTR_CSI .. "39m" +end + function color.escapeb(color_value) if color.disabled then return color_value @@ -72,6 +79,13 @@ function color.escapeb(color_value) return core.KEYSTR_CSI .. "4" .. color_value .. "m" end +function color.resetb() + if color.disabled then + return '' + end + return core.KEYSTR_CSI .. "49m" +end + function color.escape(fg_color, bg_color, attribute) if color.disabled then return "" @@ -98,7 +112,7 @@ function color.highlight(str) end -- We need to reset attributes as well as color scheme here, just in -- case the terminal defaults don't match what we're expecting. - return core.KEYSTR_CSI .. "1m" .. str .. color.default() + return core.KEYSTR_CSI .. "1m" .. str .. core.KEYSTR_CSI .. "22m" end return color Modified: head/stand/lua/menu.lua ============================================================================== --- head/stand/lua/menu.lua Tue Mar 20 20:20:49 2018 (r331258) +++ head/stand/lua/menu.lua Tue Mar 20 20:26:24 2018 (r331259) @@ -120,7 +120,7 @@ menu.boot_environments = { name_color = color.escapef(color.BLUE) end bootenv_name = bootenv_name .. name_color .. - choice .. color.default() + choice .. color.resetf() return color.highlight("A").."ctive: " .. bootenv_name .. " (" .. idx .. " of " .. #all_choices .. ")" @@ -306,7 +306,7 @@ menu.welcome = { name_color = color.escapef(color.BLUE) end kernel_name = kernel_name .. name_color .. - choice .. color.default() + choice .. color.resetf() return color.highlight("K") .. "ernel: " .. kernel_name .. " (" .. idx .. " of " .. #all_choices .. ")"