lualoader: More black-on-white fixes
To recap the problem: with a black-on-white xterm, the menu draws terribly. Ideally, we would try our best for a white-on-black context for the menu since graphics and whatnot might not be tested for other setups and there's no reasonable way to sample the terminal at this point for the used color scheme. This commit attempts to address that further in two ways: - Instead of issuing CSI bg/fg resets (CSI 39m and CSI 49m respectively for "default"), issue CSI bg/fg escape sequences for our expected color scheme - Reset to *our* default color scheme before we even attempt to load the local module, so that we personally don't have any earlier text with the console default color scheme. Reported by: emaste (again)
This commit is contained in:
parent
3e9b9088a0
commit
b3e246ad5e
@ -69,7 +69,7 @@ function color.resetfg()
|
||||
if color.disabled then
|
||||
return ''
|
||||
end
|
||||
return core.KEYSTR_CSI .. "39m"
|
||||
return color.escapefg(color.WHITE)
|
||||
end
|
||||
|
||||
function color.escapebg(color_value)
|
||||
@ -83,7 +83,7 @@ function color.resetbg()
|
||||
if color.disabled then
|
||||
return ''
|
||||
end
|
||||
return core.KEYSTR_CSI .. "49m"
|
||||
return color.escapebg(color.BLACK)
|
||||
end
|
||||
|
||||
function color.escape(fg_color, bg_color, attribute)
|
||||
|
@ -42,6 +42,12 @@ local password = require("password")
|
||||
-- need it.
|
||||
local menu
|
||||
|
||||
-- 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
|
||||
|
||||
try_include("local")
|
||||
|
||||
config.load()
|
||||
@ -51,11 +57,6 @@ end
|
||||
if core.isUEFIBoot() then
|
||||
loader.perform("efi-autoresizecons")
|
||||
end
|
||||
-- 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()
|
||||
-- menu might be disabled
|
||||
if menu ~= nil then
|
||||
|
Loading…
Reference in New Issue
Block a user