fix: preserve wrapped input display in colored prompts

This commit is contained in:
Unilinear 2026-08-20 14:44:01 +08:00
parent f9e8b280f7
commit fe32cd7ecf
13 changed files with 24 additions and 24 deletions

View file

@ -125,7 +125,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms01 >> \033[0m")
query = input("\001\033[36m\002s01 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -178,7 +178,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms02 >> \033[0m")
query = input("\001\033[36m\002s02 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -228,7 +228,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms03 >> \033[0m")
query = input("\001\033[36m\002s03 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -241,7 +241,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms04 >> \033[0m")
query = input("\001\033[36m\002s04 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -333,7 +333,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms05 >> \033[0m")
query = input("\001\033[36m\002s05 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -349,7 +349,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms06 >> \033[0m")
query = input("\001\033[36m\002s06 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -364,7 +364,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms07 >> \033[0m")
query = input("\001\033[36m\002s07 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -485,7 +485,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms08 >> \033[0m")
query = input("\001\033[36m\002s08 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -743,7 +743,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms09 >> \033[0m")
query = input("\001\033[36m\002s09 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -567,7 +567,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms10 >> \033[0m")
query = input("\001\033[36m\002s10 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -485,7 +485,7 @@ if __name__ == "__main__":
history = []
while True:
try:
query = input("\033[36ms11 >> \033[0m")
query = input("\001\033[36m\002s11 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

View file

@ -758,7 +758,7 @@ if __name__ == "__main__":
try:
while True:
try:
query = input("\033[36ms12 >> \033[0m")
query = input("\001\033[36m\002s12 >> \001\033[0m\002")
except (EOFError, KeyboardInterrupt):
break
if query.strip().lower() in ("q", "exit", ""):

File diff suppressed because one or more lines are too long