Mercurial > prosody-hg
changeset 14099:b5002c87db0b
util.termcolours: Remove leftovers of conhost text painting
Remove code that was painting the Prosody log using Windows Console Host
functions. Windows has native support of ANSI colors for a decade, so we don't
need this anymore.
| author | Vitaly Orekhov <vkvo2000@vivaldi.net> |
|---|---|
| date | Sun, 08 Mar 2026 19:30:54 +0300 |
| parents | 151babd0853b |
| children | a124e80d3498 |
| files | util/termcolours.lua |
| diffstat | 1 files changed, 0 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/util/termcolours.lua Thu Mar 05 10:24:56 2026 -0500 +++ b/util/termcolours.lua Sun Mar 08 19:30:54 2026 +0300 @@ -18,13 +18,6 @@ local type = type; local setmetatable = setmetatable; local pairs = pairs; - -local windows; -if os.getenv("WINDIR") then - windows = require "prosody.util.windows"; -end -local orig_color = windows and windows.get_consolecolor and windows.get_consolecolor(); - local _ENV = nil; -- luacheck: std none @@ -36,13 +29,6 @@ bold = 1, dark = 2, underline = 4, underlined = 4, normal = 0; } -local winstylemap = { - ["0"] = orig_color, -- reset - ["1"] = 7+8, -- bold - ["1;33"] = 2+4+8, -- bold yellow - ["1;31"] = 4+8 -- bold red -} - local cssmap = { [1] = "font-weight: bold", [2] = "opacity: 0.5", [4] = "text-decoration: underline", [8] = "visibility: hidden", [30] = "color:black", [31] = "color:red", [32]="color:green", [33]="color:#FFD700", @@ -118,19 +104,6 @@ end end -if windows then - function setstyle(style) - style = style or "0"; - if style ~= last then - windows.set_consolecolor(winstylemap[style] or orig_color); - last = style; - end - end - if not orig_color then - function setstyle() end - end -end - local function ansi2css(ansi_codes) if ansi_codes == "0" then return "</span>"; end local css = {};
