[pacman-dev] coloured pacman

Dan McGee dpmcgee at gmail.com
Tue Feb 6 15:11:06 EST 2007


On 2/6/07, Jürgen Hötzel <juergen at hoetzel.info> wrote:
> Its not easy to display colored text in a portable way. An easy, but
> wrong way is using ANSI escape sequences directly because you make
> assumption about the tty.
>
> A much more portable way is querying the database of terminal capabilities
> (termcap/terminfo).
>
> Jürgen

Much better put than my point about hardcoding the escape sequences in
C code. Although not necessarily good in a bash script, the code can
be edited if necessary quite easily to fix escape sequences. However,
Jürgen makes the excellent point that these escape sequences cannot
always be assumed to be portable.

-Dan


More information about the pacman-dev mailing list