Start at http://bash-hackers.org/wiki/doku.php/scripting/terminalcodes
commands like "ls --color" does not use terminfo capabilities... $ hexdump -c <(TERM=xterm ls -d / --color=always) 0000000 033 [ 0 0 m 033 [ 0 1 ; 3 4 m / 033 [ 0000010 0 0 m \n 033 [ m 0000017 $ hexdump -c <(TERM=dumb ls -d / --color=always) 0000000 033 [ 0 0 m 033 [ 0 1 ; 3 4 m / 033 [ 0000010 0 0 m \n 033 [ m 0000017 ...use instead fixed strings (without regards about TERMinal) is this a good (and safe) choice too?