# HG changeset patch # User Vitaly Orekhov # Date 1772987454 -10800 # Node ID b5002c87db0bcd8b8f9f2d5cbf9dbaa4a548b5ee # Parent 151babd0853b4ff478e53f0082243bd38ee25334 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. diff -r 151babd0853b -r b5002c87db0b util/termcolours.lua --- 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 ""; end local css = {};