From 33b11d0efb95b5471db97f118c6c823fe20e9a7f Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 10 Sep 2024 14:48:54 -0700 Subject: [PATCH] refactor: simplify console initialization and error handling --- aider/io.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/aider/io.py b/aider/io.py index 44ddd336d..521d548e4 100644 --- a/aider/io.py +++ b/aider/io.py @@ -226,14 +226,12 @@ class InputOutput: session_kwargs["history"] = FileHistory(self.input_history_file) try: self.prompt_session = PromptSession(**session_kwargs) + self.console = Console() # pretty console except Exception as err: - self.tool_error(f"Can't initialize prompt toolkit: {err}") - self.pretty = False - - if self.pretty: - self.console = Console() + self.console = Console(force_terminal=False, no_color=True) + self.tool_error(f"Can't initialize prompt toolkit: {err}") # non-pretty else: - self.console = Console(force_terminal=False, no_color=True) + self.console = Console(force_terminal=False, no_color=True) # non-pretty def read_image(self, filename): try: