feat: add exit event tracking for Control-C and /exit commands

This commit is contained in:
Paul Gauthier 2024-11-30 09:52:59 -08:00
parent c1c4193b1d
commit 295040c94c
2 changed files with 5 additions and 1 deletions

View file

@ -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")