diff --git a/langcode.py b/langcode.py index f1eded4..df68cca 100755 --- a/langcode.py +++ b/langcode.py @@ -142,13 +142,23 @@ def cmd_chat(args): print("📝 Uso CLI semplice...") # CLI semplice con input() + # Reset terminal state dopo eventuale EnhancedCLI fallito + import subprocess + try: + subprocess.run(["stty", "sane"], check=False, capture_output=True) + except: + pass + print("\n" + "=" * 60) print(" CLI SEMPLICE - digita /exit per uscire") print("=" * 60 + "\n") while True: try: - user_input = input("❯ ").strip() + sys.stdout.flush() + sys.stdout.write("❯ ") + sys.stdout.flush() + user_input = sys.stdin.readline().strip() if not user_input: continue