xterm2ansi is a command line utility for converting xterm escape codes to ANSI escape codes. It can convert xterm-256 escape codes to 4-bit ANSI escape codes.
echo -e "text with xterm-256 escaped codes" | xterm2ansixterm2ansi input.file[ansi_output_command] | xterm2ansi
echo -e "\033[38;5;80mcyan\033[m" | xterm2ansi | cat -v
# ^[[36mcyan^[[0mgit clone https://github.com/zaidhaan/xterm2ansi.git
cd xterm2ansi
make
make installUnlikely I'll work on this for long, but might be helpful to have
- input specified by
-f - parse first as input if no
-fspecified - help and man page?