Skip to content

Uncaught exception when using --user-input-color with wrong format #2922

Open
@ghassentheben

Description

@ghassentheben

input: aider --user-input-color bcbdbf (missing # in color)
exception output:

Aider version: 0.71.1
Python version: 3.12.8
Platform: macOS-15.0.1-arm64-arm-64bit
Python implementation: CPython
Virtual environment: Yes
OS: Darwin 24.0.0 (64bit)
Git version: git version 2.39.5 (Apple Git-154)

An uncaught exception occurred:

Traceback (most recent call last):
  File "aider", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "main.py", line 1036, in main
    coder.run()
  File "base_coder.py", line 821, in run
    user_message = self.get_input()
                   ^^^^^^^^^^^^^^^^
  File "base_coder.py", line 838, in get_input
    return self.io.get_input(
           ^^^^^^^^^^^^^^^^^^
  File "io.py", line 435, in get_input
    style = self._get_style()
            ^^^^^^^^^^^^^^^^^
  File "io.py", line 318, in _get_style
    return Style.from_dict(style_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "style.py", line 266, in from_dict
    return cls(list(style_dict.items()))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "style.py", line 239, in __init__
    attrs = _parse_style_str(style_str)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "style.py", line 172, in _parse_style_str
    attrs = attrs._replace(color=parse_color(part))
                                 ^^^^^^^^^^^^^^^^^
  File "style.py", line 76, in parse_color
    raise ValueError(f"Wrong color format {text!r}")
ValueError: Wrong color format 'bcbdbf'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions