mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
ensure the Live is stopped if exceptions occur
This commit is contained in:
parent
d44f732d3b
commit
f29eaf451b
1 changed files with 23 additions and 22 deletions
|
@ -343,11 +343,13 @@ class Coder:
|
|||
return self.resp, interrupted
|
||||
|
||||
def show_send_output(self, completion, silent):
|
||||
live = None
|
||||
if self.pretty and not silent:
|
||||
live = Live(vertical_overflow="scroll")
|
||||
|
||||
try:
|
||||
if live:
|
||||
live.start()
|
||||
else:
|
||||
live = None
|
||||
|
||||
for chunk in completion:
|
||||
if chunk.choices[0].finish_reason not in (None, "stop"):
|
||||
|
@ -368,7 +370,7 @@ class Coder:
|
|||
else:
|
||||
sys.stdout.write(text)
|
||||
sys.stdout.flush()
|
||||
|
||||
finally:
|
||||
if live:
|
||||
live.stop()
|
||||
|
||||
|
@ -517,7 +519,6 @@ class Coder:
|
|||
|
||||
res = self.prompt_ask(
|
||||
"[bright_black]Commit before the chat proceeds? \[y/n/commit message]", # noqa: W605 E501
|
||||
console=self.console,
|
||||
default="y",
|
||||
).strip()
|
||||
self.console.print()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue