fix: EnhancedCLI timeout e fallback a CLI semplice
- Rimosso CursorShape.BEAM che causa hang su alcuni terminali - Aggiunto timeout 30s con fallback a CLI semplice - Cattura KeyboardInterrupt, EOFError, OSError per hang - Signal handler per Ctrl+C in EnhancedCLI
This commit is contained in:
1 parent
e75a75e16c
commit
453156148c
2 files changed
+31
-2
No files matched your search
+10
-1
@@ -428,7 +428,6 @@ class EnhancedCLI:
|
||||
key_bindings=self.key_bindings,
|
||||
auto_suggest=AutoSuggestFromHistory(),
|
||||
multiline=True,
|
||||
cursor=CursorShape.BEAM,
|
||||
mouse_support=self.enable_mouse,
|
||||
)
|
||||
|
||||
@@ -656,6 +655,16 @@ class EnhancedCLI:
|
||||
Args:
|
||||
agent_callback: Function that takes user input and returns agent response
|
||||
"""
|
||||
import signal
|
||||
import sys
|
||||
|
||||
# Register signal handler for Ctrl+C
|
||||
def handle_sigint(signum, frame):
|
||||
print("\n\n👋 Arrivederci!")
|
||||
sys.exit(0)
|
||||
|
||||
signal.signal(signal.SIGINT, handle_sigint)
|
||||
|
||||
# Print welcome
|
||||
print(self.welcome_message)
|
||||
|
||||
|
||||
Reference in new issue
Block a user