diff --git a/stand/lua/color.lua b/stand/lua/color.lua index 870e921e2f77..364d548ca3dc 100644 --- a/stand/lua/color.lua +++ b/stand/lua/color.lua @@ -29,9 +29,14 @@ -- local core = require("core") +local hook = require("hook") local color = {} +local function recalcDisabled() + color.disabled = not color.isEnabled() +end + -- Module exports color.BLACK = 0 color.RED = 1 @@ -54,8 +59,6 @@ function color.isEnabled() return not core.isSerialBoot() end -color.disabled = not color.isEnabled() - function color.escapefg(color_value) if color.disabled then return '' @@ -113,4 +116,7 @@ function color.highlight(str) return core.KEYSTR_CSI .. "1m" .. str .. core.KEYSTR_CSI .. "22m" end +recalcDisabled() +hook.register("config.loaded", recalcDisabled) + return color