Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Here is a sample of conversation:
=======================================
› visualizza una tabella formattata in ANSI
• Esegui questo in terminale (usa tput, quindi niente codici ANSI “hardcoded”):
bold=$(tput bold); reset=$(tput sgr0)
cyan=$(tput setaf 6); green=$(tput setaf 2); red=$(tput setaf 1)
printf "┌────┬────────────┬────────┐\n"
printf "│ %s%s%-2s%s │ %s%s%-10s%s │ %s%s%-6s%s │\n"
"$bold" "$cyan" "ID" "$reset" "$bold" "$cyan" "NOME" "$reset" "$bold" "$cyan" "STATO" "$reset"
printf "├────┼────────────┼────────┤\n"
printf "│ %-2s │ %-10s │ %s%-6s%s │\n" "1" "alpha" "$green" "OK" "$reset"
printf "│ %-2s │ %-10s │ %s%-6s%s │\n" "2" "beta" "$red" "FAIL" "$reset"
printf "└────┴────────────┴────────┘\n"
› Usa ANSI escape codes diretti non tput
• printf '\033[1m\033[36m┌────┬────────────┬────────┐\033[0m\n'
printf '\033[1m\033[36m│ ID │ NOME │ STATO │\033[0m\n'
printf '\033[1m\033[36m├────┼────────────┼────────┤\033[0m\n'
printf '│ 1 │ alpha │ \033[32mOK\033[0m │\n'
printf '│ 2 │ beta │ \033[31mFAIL\033[0m │\n'
printf '\033[1m\033[36m└────┴────────────┴────────┘\033[0m\n'
› non visualizzare printf semplicemente formatta l'output della tabella in ANSI
• ┌────┬────────────┬────────┐
│ ID │ NOME │ STATO │
├────┼────────────┼────────┤
│ 1 │ alpha │ OK │
│ 2 │ beta │ FAIL │
└────┴────────────┴────────┘
=======================================
on the end Codex terminal was able to produce a good formatted table, but it required some interactions.
Is it possible to improve formatted output in ANSI by default for any Codex answer that may require it?
Beta Was this translation helpful? Give feedback.
All reactions