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:
parent
476da9c530
commit
3c286dfb69
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user