mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 10:14:59 +00:00
fix: improve error handling in input interruption flow
This commit is contained in:
parent
a999020038
commit
8e81300f37
1 changed files with 5 additions and 1 deletions
|
@ -350,6 +350,7 @@ class InputOutput:
|
||||||
def interrupt_input(self):
|
def interrupt_input(self):
|
||||||
if self.prompt_session and self.prompt_session.app:
|
if self.prompt_session and self.prompt_session.app:
|
||||||
self.prompt_session.app.exit()
|
self.prompt_session.app.exit()
|
||||||
|
print("interrupting")
|
||||||
|
|
||||||
def get_input(
|
def get_input(
|
||||||
self,
|
self,
|
||||||
|
@ -440,14 +441,17 @@ class InputOutput:
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
line = input(show)
|
line = input(show)
|
||||||
except EOFError:
|
|
||||||
# Check if we were interrupted by a file change
|
# Check if we were interrupted by a file change
|
||||||
if self.changed_files:
|
if self.changed_files:
|
||||||
changed = self.changed_files
|
changed = self.changed_files
|
||||||
self.changed_files = None
|
self.changed_files = None
|
||||||
dump(changed)
|
dump(changed)
|
||||||
return f"/add {changed}" # Return an edit command for the changed file
|
return f"/add {changed}" # Return an edit command for the changed file
|
||||||
|
except EOFError:
|
||||||
return ""
|
return ""
|
||||||
|
except Exception as err:
|
||||||
|
dump(err)
|
||||||
|
|
||||||
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