From 4a034bad212b65b7a1ec515d5f5bc49aa7e5edff Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Tue, 20 Mar 2018 20:05:11 +0000 Subject: [PATCH] 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 --- stand/lua/color.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stand/lua/color.lua b/stand/lua/color.lua index 532482c6804..8aa9fe25eba 100644 --- a/stand/lua/color.lua +++ b/stand/lua/color.lua @@ -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