fix: paginazione output con stile 'more'
- Output mostrato in blocchi da 15 righe - Premi ENTER per continuare, 'q' per uscire - SepARATOR visivo tra pagine
This commit is contained in:
1 parent
3197dedd4c
commit
f1d1248d4b
1 file changed
+18
-4
+18
-4
@@ -169,11 +169,25 @@ Comandi disponibili:
|
||||
|
||||
# Strip ANSI codes per terminali semplici
|
||||
clean_response = strip_ansi(response)
|
||||
print(f"🤖 {clean_response}\n")
|
||||
|
||||
# Info scroll per output lunghi
|
||||
if len(clean_response) > 1000:
|
||||
print("💡 Suggerimento: scorri con Shift+PgUp / Shift+PgDn o mouse\n")
|
||||
# Paginazione con 'more' style per output lunghi
|
||||
lines = clean_response.split('\n')
|
||||
if len(lines) > 15:
|
||||
for i in range(0, len(lines), 15):
|
||||
chunk = '\n'.join(lines[i:i+15])
|
||||
print(f"🤖 {chunk}")
|
||||
if i + 15 < len(lines):
|
||||
print("\n" + "─" * 40)
|
||||
print("Premi ENTER per continuare, 'q' per uscire: ", end="")
|
||||
try:
|
||||
user_char = input()
|
||||
if user_char.lower() == 'q':
|
||||
break
|
||||
except:
|
||||
break
|
||||
print()
|
||||
else:
|
||||
print(f"🤖 {clean_response}\n")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n👋 Arrivederci!")
|
||||
|
||||
Reference in new issue
Block a user