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
This commit is contained in:
parent
d9d3a08ed4
commit
85efc91a3c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=331211
@ -89,7 +89,7 @@ function color.default()
|
|||||||
if color.disabled then
|
if color.disabled then
|
||||||
return ""
|
return ""
|
||||||
end
|
end
|
||||||
return core.KEYSTR_CSI .. "0;37;40m"
|
return color.escape(color.WHITE, color.BLACK, color.DEFAULT)
|
||||||
end
|
end
|
||||||
|
|
||||||
function color.highlight(str)
|
function color.highlight(str)
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
-- Other modules will also need some of the functions it defines to safely
|
-- Other modules will also need some of the functions it defines to safely
|
||||||
-- execute loader commands.
|
-- execute loader commands.
|
||||||
require("cli")
|
require("cli")
|
||||||
|
local color = require("color")
|
||||||
local core = require("core")
|
local core = require("core")
|
||||||
local config = require("config")
|
local config = require("config")
|
||||||
local menu
|
local menu
|
||||||
@ -49,6 +50,11 @@ if result ~= nil then
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.load()
|
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()
|
password.check()
|
||||||
-- menu might be disabled
|
-- menu might be disabled
|
||||||
if menu ~= nil then
|
if menu ~= nil then
|
||||||
|
Loading…
Reference in New Issue
Block a user