mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
feat: add exit event tracking for Control-C and /exit commands
This commit is contained in:
parent
c1c4193b1d
commit
295040c94c
2 changed files with 5 additions and 1 deletions
|
@ -885,6 +885,7 @@ class Coder:
|
|||
thresh = 2 # seconds
|
||||
if self.last_keyboard_interrupt and now - self.last_keyboard_interrupt < thresh:
|
||||
self.io.tool_warning("\n\n^C KeyboardInterrupt")
|
||||
self.event("exit", reason="Control-C")
|
||||
sys.exit()
|
||||
|
||||
self.io.tool_warning("\n\n^C again to exit")
|
||||
|
|
|
@ -909,6 +909,7 @@ class Commands:
|
|||
|
||||
def cmd_exit(self, args):
|
||||
"Exit the application"
|
||||
self.coder.event("exit", reason="/exit")
|
||||
sys.exit()
|
||||
|
||||
def cmd_quit(self, args):
|
||||
|
@ -1085,7 +1086,9 @@ class Commands:
|
|||
self.io.tool_error("To use /voice you must provide an OpenAI API key.")
|
||||
return
|
||||
try:
|
||||
self.voice = voice.Voice(audio_format=self.args.voice_format, device_name=self.args.voice_input_device)
|
||||
self.voice = voice.Voice(
|
||||
audio_format=self.args.voice_format, device_name=self.args.voice_input_device
|
||||
)
|
||||
except voice.SoundDeviceError:
|
||||
self.io.tool_error(
|
||||
"Unable to import `sounddevice` and/or `soundfile`, is portaudio installed?"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue