mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: add input interruption from background threads
This commit is contained in:
parent
17ce2a3cad
commit
3db3150a7e
1 changed files with 18 additions and 11 deletions
|
@ -345,6 +345,10 @@ class InputOutput:
|
|||
else:
|
||||
print()
|
||||
|
||||
def interrupt_input(self):
|
||||
if self.prompt_session and self.prompt_session.app:
|
||||
self.prompt_session.app.exit()
|
||||
|
||||
def get_input(
|
||||
self,
|
||||
root,
|
||||
|
@ -398,6 +402,7 @@ class InputOutput:
|
|||
if multiline_input:
|
||||
show = ". "
|
||||
|
||||
try:
|
||||
try:
|
||||
if self.prompt_session:
|
||||
line = self.prompt_session.prompt(
|
||||
|
@ -410,6 +415,8 @@ class InputOutput:
|
|||
)
|
||||
else:
|
||||
line = input(show)
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
return ""
|
||||
except UnicodeEncodeError as err:
|
||||
self.tool_error(str(err))
|
||||
return ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue