mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 11:45:00 +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
|
return inp
|
||||||
|
|
||||||
def keyboard_interrupt(self):
|
def keyboard_interrupt(self):
|
||||||
|
# Ensure cursor is visible on exit
|
||||||
|
Console().show_cursor(True)
|
||||||
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
|
|
||||||
thresh = 2 # seconds
|
thresh = 2 # seconds
|
||||||
if self.last_keyboard_interrupt and now - self.last_keyboard_interrupt < thresh:
|
if self.last_keyboard_interrupt and now - self.last_keyboard_interrupt < thresh:
|
||||||
self.io.tool_warning("\n\n^C KeyboardInterrupt")
|
self.io.tool_warning("\n\n^C KeyboardInterrupt")
|
||||||
# Ensure cursor is visible on exit
|
|
||||||
Console().show_cursor(True)
|
|
||||||
self.event("exit", reason="Control-C")
|
self.event("exit", reason="Control-C")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue