qr: fix fg=-1 with z=1

This commit is contained in:
ed 2025-08-21 19:14:45 +02:00
parent cd8771fa52
commit 63d4ec64cd

View file

@ -636,6 +636,8 @@ class TcpSrv(object):
halfc = "\033[40;48;5;{0}m{1}\033[47;48;5;{2}m" halfc = "\033[40;48;5;{0}m{1}\033[47;48;5;{2}m"
if not fg: if not fg:
halfc = "\033[0;40m{1}\033[0;47m" halfc = "\033[0;40m{1}\033[0;47m"
if nocolor:
halfc = "\033[0;7m{1}\033[0m"
def ansify(m: re.Match) -> str: def ansify(m: re.Match) -> str:
return halfc.format(fg, " " * len(m.group(1)), bg) return halfc.format(fg, " " * len(m.group(1)), bg)