mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
refactor: simplify console initialization and error handling
This commit is contained in:
parent
fd18adb072
commit
33b11d0efb
1 changed files with 4 additions and 6 deletions
10
aider/io.py
10
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue