lualoader: don't botch disabling of color

When colors are disabled, color.escape{fg,bg} would return the passed in
color rather than the proper ANSI sequence for the color.
color.escape{fg,bg} would be wrong.

Instead return '', as the associated reset* functions will also return ''.
This should get rid of the funky '2' and '4' in the kernel selector if
you're booting serial.

Reported by:	npn
This commit is contained in:
kevans 2019-10-21 20:09:43 +00:00
parent 476da9c530
commit 3c286dfb69
2 changed files with 4 additions and 4 deletions

View File

@ -58,7 +58,7 @@ color.disabled = not color.isEnabled()
function color.escapefg(color_value)
if color.disabled then
return color_value
return ''
end
return core.KEYSTR_CSI .. "3" .. color_value .. "m"
end
@ -72,7 +72,7 @@ end
function color.escapebg(color_value)
if color.disabled then
return color_value
return ''
end
return core.KEYSTR_CSI .. "4" .. color_value .. "m"
end

View File

@ -47,14 +47,14 @@ end
function screen.setforeground(color_value)
if color.disabled then
return color_value
return
end
printc(color.escapefg(color_value))
end
function screen.setbackground(color_value)
if color.disabled then
return color_value
return
end
printc(color.escapebg(color_value))
end