mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-09-20 12:13:38 +08:00
fix: complete readline prompt coverage
This commit is contained in:
@@ -23,6 +23,12 @@ import os
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
try:
|
||||
import readline
|
||||
readline.parse_and_bind('set bind-tty-special-chars off')
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
from anthropic import Anthropic
|
||||
from dotenv import load_dotenv
|
||||
|
||||
@@ -136,7 +142,8 @@ if __name__ == "__main__":
|
||||
history = []
|
||||
while True:
|
||||
try:
|
||||
query = input("\033[36ms02 >> \033[0m")
|
||||
# \001/\002 tell Readline the ANSI escapes have zero display width.
|
||||
query = input("\001\033[36m\002s02 >> \001\033[0m\002")
|
||||
except (EOFError, KeyboardInterrupt):
|
||||
break
|
||||
if query.strip().lower() in ("q", "exit", ""):
|
||||
|
||||
Reference in New Issue
Block a user