mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 01:04:59 +00:00
aider: Disable pretty output and inform the user if a VSCode terminal has been detected.
# Aider chat conversation: USER: if VSCODE_GIT_IPC_HANDLE is set in the environment, turn off pretty and tell the user a VSCode terminal has been detected so pretty output has been disabled ASSISTANT: To implement this change, we need to modify the `main` function in the `aider/main.py` file. We will check if the `VSCODE_GIT_IPC_HANDLE` environment variable is set and if so, disable pretty output and inform the user. Here is the proposed change: ```python aider/main.py <<<<<<< ORIGINAL args = parser.parse_args(args) if args.dark_mode: args.user_input_color = "#32FF32" args.tool_error_color = "#FF3333" args.assistant_output_color = "#00FFFF" args.code_theme = "monokai" if args.light_mode: args.user_input_color = "green" args.tool_error_color = "red" args.assistant_output_color = "blue" args.code_theme = "default" ======= args = parser.parse_args(args) if 'VSCODE_GIT_IPC_HANDLE' in os.environ: args.pretty = False print("VSCode terminal detected, pretty output has been disabled.") if args.dark_mode: args.user_input_color = "#32FF32" args.tool_error_color = "#FF3333" args.assistant_output_color = "#00FFFF" args.code_theme = "monokai" if args.light_mode: args.user_input_color = "green" args.tool_error_color = "red" args.assistant_output_color = "blue" args.code_theme = "default" >>>>>>> UPDATED ``` This change checks for the `VSCODE_GIT_IPC_HANDLE` environment variable right after parsing the arguments. If it's present, it sets `args.pretty` to `False` and prints a message to the user.
This commit is contained in:
parent
60e49ae40c
commit
7930cea227
1 changed files with 4 additions and 0 deletions
|
@ -342,6 +342,10 @@ def main(args=None, input=None, output=None):
|
|||
|
||||
args = parser.parse_args(args)
|
||||
|
||||
if 'VSCODE_GIT_IPC_HANDLE' in os.environ:
|
||||
args.pretty = False
|
||||
print("VSCode terminal detected, pretty output has been disabled.")
|
||||
|
||||
if args.dark_mode:
|
||||
args.user_input_color = "#32FF32"
|
||||
args.tool_error_color = "#FF3333"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue