mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
Merge pull request #1634 from smh/customize-completion-menu-colors
style: completion menu colors customizable
This commit is contained in:
commit
bbfafed372
4 changed files with 56 additions and 1 deletions
|
@ -337,6 +337,30 @@ def get_parser(default_config_files, git_root):
|
|||
default="#0088ff",
|
||||
help="Set the color for assistant output (default: #0088ff)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--completion-menu-color",
|
||||
metavar="COLOR",
|
||||
default="default",
|
||||
help="Set the color for the completion menu (default: terminal's default text color)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--completion-menu-bg-color",
|
||||
metavar="COLOR",
|
||||
default="default",
|
||||
help="Set the background color for the completion menu (default: terminal's default background color)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--completion-menu-current-color",
|
||||
metavar="COLOR",
|
||||
default="default",
|
||||
help="Set the color for the current item in the completion menu (default: terminal's default background color)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--completion-menu-current-bg-color",
|
||||
metavar="COLOR",
|
||||
default="default",
|
||||
help="Set the background color for the current item in the completion menu (default: terminal's default text color)",
|
||||
)
|
||||
group.add_argument(
|
||||
"--code-theme",
|
||||
default="default",
|
||||
|
|
17
aider/io.py
17
aider/io.py
|
@ -180,6 +180,10 @@ class InputOutput:
|
|||
tool_error_color="red",
|
||||
tool_warning_color="#FFA500",
|
||||
assistant_output_color="blue",
|
||||
completion_menu_color="default",
|
||||
completion_menu_bg_color="default",
|
||||
completion_menu_current_color="default",
|
||||
completion_menu_current_bg_color="default",
|
||||
code_theme="default",
|
||||
encoding="utf-8",
|
||||
dry_run=False,
|
||||
|
@ -196,6 +200,11 @@ class InputOutput:
|
|||
self.tool_error_color = tool_error_color if pretty else None
|
||||
self.tool_warning_color = tool_warning_color if pretty else None
|
||||
self.assistant_output_color = assistant_output_color
|
||||
self.completion_menu_color = completion_menu_color if pretty else None
|
||||
self.completion_menu_bg_color = completion_menu_bg_color if pretty else None
|
||||
self.completion_menu_current_color = completion_menu_current_color if pretty else None
|
||||
self.completion_menu_current_bg_color = completion_menu_current_bg_color if pretty else None
|
||||
|
||||
self.code_theme = code_theme
|
||||
|
||||
self.input = input
|
||||
|
@ -322,6 +331,8 @@ class InputOutput:
|
|||
{
|
||||
"": self.user_input_color,
|
||||
"pygments.literal.string": f"bold italic {self.user_input_color}",
|
||||
"completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}",
|
||||
"completion-menu.completion.current": f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}",
|
||||
}
|
||||
)
|
||||
else:
|
||||
|
@ -466,7 +477,11 @@ class InputOutput:
|
|||
self.tool_output(subject, bold=True)
|
||||
|
||||
if self.pretty and self.user_input_color:
|
||||
style = {"": self.user_input_color}
|
||||
style = {
|
||||
"": self.user_input_color,
|
||||
"completion-menu": f"bg:{self.completion_menu_bg_color} {self.completion_menu_color}",
|
||||
"completion-menu.completion.current": f"bg:{self.completion_menu_current_bg_color} {self.completion_menu_current_color}",
|
||||
}
|
||||
else:
|
||||
style = dict()
|
||||
|
||||
|
|
|
@ -413,6 +413,10 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
|||
user_input_color=args.user_input_color,
|
||||
tool_output_color=args.tool_output_color,
|
||||
tool_error_color=args.tool_error_color,
|
||||
completion_menu_color=args.completion_menu_color,
|
||||
completion_menu_bg_color=args.completion_menu_bg_color,
|
||||
completion_menu_current_color=args.completion_menu_current_color,
|
||||
completion_menu_current_bg_color=args.completion_menu_current_bg_color,
|
||||
assistant_output_color=args.assistant_output_color,
|
||||
code_theme=args.code_theme,
|
||||
dry_run=args.dry_run,
|
||||
|
|
|
@ -165,6 +165,18 @@
|
|||
## Set the color for assistant output (default: #0088ff)
|
||||
#AIDER_ASSISTANT_OUTPUT_COLOR=#0088ff
|
||||
|
||||
## Set the foreground color for the completion menu (default: terminal's default text color)
|
||||
#AIDER_COMPLETION_MENU_COLOR=default
|
||||
|
||||
## Set the background color for the completion menu (default: terminal's default background color)
|
||||
#AIDER_COMPLETION_MENU_BG_COLOR=default
|
||||
|
||||
## Set the foreground color for the current item in the completion menu (default: terminal's default background color)
|
||||
#AIDER_COMPLETION_MENU_CURRENT_COLOR=default
|
||||
|
||||
## Set the background color for the current item in the completion menu (default: terminal's default text color)
|
||||
#AIDER_COMPLETION_MENU_CURRENT_BG_COLOR=default
|
||||
|
||||
## Set the markdown code theme (default: default, other options include monokai, solarized-dark, solarized-light)
|
||||
#AIDER_CODE_THEME=default
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue