mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 18:54:59 +00:00
fix: Ensure cursor is shown on first Ctrl+C
This commit is contained in:
parent
0632c7a90f
commit
1b2eeaff56
1 changed files with 3 additions and 2 deletions
|
@ -978,13 +978,14 @@ class Coder:
|
|||
return inp
|
||||
|
||||
def keyboard_interrupt(self):
|
||||
# Ensure cursor is visible on exit
|
||||
Console().show_cursor(True)
|
||||
|
||||
now = time.time()
|
||||
|
||||
thresh = 2 # seconds
|
||||
if self.last_keyboard_interrupt and now - self.last_keyboard_interrupt < thresh:
|
||||
self.io.tool_warning("\n\n^C KeyboardInterrupt")
|
||||
# Ensure cursor is visible on exit
|
||||
Console().show_cursor(True)
|
||||
self.event("exit", reason="Control-C")
|
||||
sys.exit()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue