mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
fix: Show cursor on KeyboardInterrupt exit
This commit is contained in:
parent
91d7fbd659
commit
c806f18698
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,7 @@ try:
|
||||||
except ImportError: # Babel not installed – we will fall back to a small mapping
|
except ImportError: # Babel not installed – we will fall back to a small mapping
|
||||||
Locale = None
|
Locale = None
|
||||||
from json.decoder import JSONDecodeError
|
from json.decoder import JSONDecodeError
|
||||||
|
from rich.console import Console
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -981,6 +982,8 @@ class Coder:
|
||||||
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