Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Mar 2018 15:28:19 -0500
From:      Kyle Evans <kevans@freebsd.org>
To:        Devin Teske <dteske@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r331257 - head/stand/lua
Message-ID:  <CACNAnaE3V-BQamcVqCV7v4BqgjqXKk_VVL=ddTyKYn1-ZkZFJQ@mail.gmail.com>
In-Reply-To: <C35FF1F8-E779-4ED8-A508-D0A284619088@freebsd.org>
References:  <201803202005.w2KK5CFl026172@repo.freebsd.org> <C35FF1F8-E779-4ED8-A508-D0A284619088@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 20, 2018 at 3:15 PM, Devin Teske <dteske@freebsd.org> wrote:
>
>> On Mar 20, 2018, at 1:05 PM, Kyle Evans <kevans@FreeBSD.org> wrote:
>>
>> Author: kevans
>> Date: Tue Mar 20 20:05:11 2018
>> New Revision: 331257
>> URL: https://svnweb.freebsd.org/changeset/base/331257
>>
>> Log:
>>  lualoader: Reset attributes and color scheme with color.highlight()
>>
>>  Previously, we sent a CSI 0m sequence to reset attributes, which also reset
>>  the color scheme if the terminal defaults didn't match what we're expecting.
>>  Go all-in and reset the color scheme, too, just in case.
>>
>>  Reported by: emaste
>>
>> Modified:
>>  head/stand/lua/color.lua
>>
>> Modified: head/stand/lua/color.lua
>> ==============================================================================
>> --- head/stand/lua/color.lua  Tue Mar 20 19:28:52 2018        (r331256)
>> +++ head/stand/lua/color.lua  Tue Mar 20 20:05:11 2018        (r331257)
>> @@ -96,7 +96,9 @@ function color.highlight(str)
>>       if color.disabled then
>>               return str
>>       end
>> -     return core.KEYSTR_CSI .. "1m" .. str .. core.KEYSTR_CSI .. "0m"
>> +     -- 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()
>> end
>>
>> return color
>>
>
> You should CSI 22m to terminate CSI 1m
>
> The corresponding terminators for common effects:
>
> 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

Thanks! Fixed, with this map written in blood, in r331259. =) We had a
couple of other instances where we went for the 'reset everything'
approach rather than the more polite terminators.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaE3V-BQamcVqCV7v4BqgjqXKk_VVL=ddTyKYn1-ZkZFJQ>