mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45: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:
|
else:
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
def interrupt_input(self):
|
||||||
|
if self.prompt_session and self.prompt_session.app:
|
||||||
|
self.prompt_session.app.exit()
|
||||||
|
|
||||||
def get_input(
|
def get_input(
|
||||||
self,
|
self,
|
||||||
root,
|
root,
|
||||||
|
@ -398,6 +402,7 @@ class InputOutput:
|
||||||
if multiline_input:
|
if multiline_input:
|
||||||
show = ". "
|
show = ". "
|
||||||
|
|
||||||
|
try:
|
||||||
try:
|
try:
|
||||||
if self.prompt_session:
|
if self.prompt_session:
|
||||||
line = self.prompt_session.prompt(
|
line = self.prompt_session.prompt(
|
||||||
|
@ -410,6 +415,8 @@ class InputOutput:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
line = input(show)
|
line = input(show)
|
||||||
|
except (EOFError, KeyboardInterrupt):
|
||||||
|
return ""
|
||||||
except UnicodeEncodeError as err:
|
except UnicodeEncodeError as err:
|
||||||
self.tool_error(str(err))
|
self.tool_error(str(err))
|
||||||
return ""
|
return ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue