From 8e81300f3761e1b63da99f5572ad4e311c6f8659 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 25 Oct 2024 12:59:07 -0700 Subject: [PATCH] fix: improve error handling in input interruption flow --- aider/io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index eaae0d8c0..78a1060fe 100644 --- a/aider/io.py +++ b/aider/io.py @@ -350,6 +350,7 @@ class InputOutput: def interrupt_input(self): if self.prompt_session and self.prompt_session.app: self.prompt_session.app.exit() + print("interrupting") def get_input( self, @@ -440,14 +441,17 @@ class InputOutput: ) else: line = input(show) - except EOFError: # Check if we were interrupted by a file change if self.changed_files: changed = self.changed_files self.changed_files = None dump(changed) return f"/add {changed}" # Return an edit command for the changed file + except EOFError: return "" + except Exception as err: + dump(err) + except UnicodeEncodeError as err: self.tool_error(str(err)) return ""