fix: Fix ColorParseError by ensuring hex colors have # prefix

This commit is contained in:
Paul Gauthier (aider) 2025-03-31 10:32:48 +13:00
parent 1c7db4da0d
commit 605d8fe59a
2 changed files with 29 additions and 1 deletions

View file

@ -963,6 +963,7 @@ class InputOutput:
if not isinstance(message, Text):
message = Text(message)
color = ensure_hash_prefix(color) if color else None
style = dict(style=color) if self.pretty and color else dict()
try:
self.console.print(message, **style)
@ -993,7 +994,7 @@ class InputOutput:
style = dict()
if self.pretty:
if self.tool_output_color:
style["color"] = self.tool_output_color
style["color"] = ensure_hash_prefix(self.tool_output_color)
style["reverse"] = bold
style = RichStyle(**style)