From owner-svn-src-all@freebsd.org Tue Mar 20 23:04:16 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 77B17F53B8A; Tue, 20 Mar 2018 23:04:16 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FA036EE12; Tue, 20 Mar 2018 23:04:16 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=62988 helo=[10.1.4.66]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1eyO6Y-000POk-Nl; Tue, 20 Mar 2018 20:43:34 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r331259 - head/stand/lua From: Devin Teske In-Reply-To: <201803202026.w2KKQOP2036471@repo.freebsd.org> Date: Tue, 20 Mar 2018 16:04:13 -0700 Cc: Devin Teske , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <401EA542-5E2B-4342-B098-7C8D78FAD721@freebsd.org> References: <201803202026.w2KKQOP2036471@repo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3273) Sender: devin@shxd.cx 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 23:04:16 -0000 > On Mar 20, 2018, at 1:26 PM, Kyle Evans wrote: >=20 > Author: kevans > Date: Tue Mar 20 20:26:24 2018 > New Revision: 331259 > URL: https://svnweb.freebsd.org/changeset/base/331259 >=20 > Log: > lualoader: Use less atomic options for resetting colors/attributes >=20 > Noted by dteske: >=20 > 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 >=20 > - Provide resetf/resetb to match escapef/escapeb > - Use CSI 22m to undo a bold >=20 > This is a more reasonable approach than what was previously taken. >=20 > Reported by: dteske >=20 > Modified: > head/stand/lua/color.lua > head/stand/lua/menu.lua >=20 > Modified: head/stand/lua/color.lua > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 >=20 > +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 >=20 > +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 >=20 > return color >=20 > Modified: head/stand/lua/menu.lua > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- 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 =3D { > name_color =3D = color.escapef(color.BLUE) > end > bootenv_name =3D 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 =3D { > name_color =3D = color.escapef(color.BLUE) > end > kernel_name =3D kernel_name .. = name_color .. > - choice .. color.default() > + choice .. color.resetf() > return color.highlight("K") .. "ernel: " = .. > kernel_name .. " (" .. idx .. " of " = .. > #all_choices .. ")" >=20 Minor nit ... While resetf is unlikely to be mistaken for anything other than "reset = foreground", ... "resetb" could easily be mistaken for "reset bold". I would like to suggest, in tradition, that resetf/resetb be renamed to = resetfg/resetbg You know... should you want to add a "resetb" later that actually resets = bold (e.g., if you have to use CSI 22m in more than one place). --=20 Devin=