mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 17:24: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)
|
session_kwargs["history"] = FileHistory(self.input_history_file)
|
||||||
try:
|
try:
|
||||||
self.prompt_session = PromptSession(**session_kwargs)
|
self.prompt_session = PromptSession(**session_kwargs)
|
||||||
|
self.console = Console() # pretty console
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
self.tool_error(f"Can't initialize prompt toolkit: {err}")
|
self.console = Console(force_terminal=False, no_color=True)
|
||||||
self.pretty = False
|
self.tool_error(f"Can't initialize prompt toolkit: {err}") # non-pretty
|
||||||
|
|
||||||
if self.pretty:
|
|
||||||
self.console = Console()
|
|
||||||
else:
|
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):
|
def read_image(self, filename):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue