[pacman-dev] Pacman color output

VMiklos vmiklos at frugalware.org
Sun Jun 4 07:51:42 EDT 2006


On Sun, Jun 04, 2006 at 01:39:50PM +0200, Wael Nasreddine <wael at siemens-mobiles.org> wrote:
> I don't know if you have discussed this before, any chance to see
> color support to pacman's output? i really loved the way pacman does
> the download when adding "ilovecandy" to /etc/pacman.conf :D, so I

if you have ilovecandy in pacman.conf, then why not? probably it should
be disabled by default, it can cause problems on some weird terminals

> tried to add some colors but since the string length is checked in
> pm_fprintf function, it may break the message, I tried doing it in

you mean the 9 chars limit?

see this:
http://www.archlinux.org/pipermail/pacman-dev/2006-May/000313.html

if that's the problem, then just use the patch, and it'll go away :)

> another way (by simply adding an extra char *color to pm_fprintf
> function) but I am not a C++ programer so i failed specially about

pacman is written in C, not in C++

> adding strings together (color + str + CLEAR) to fprintf, anyone
> interresting in doing it ?

the coding part, yes. but i don't want to figure out what colors looks
nice :) ok, probably red for errors, but the others..

example:

$ LANG= LC_ALL= sudo pacman -Sy
:: Synchronizing package databases...

then you can say

echo -e "\e[01;36m::\e[0m \e[01mSynchronizing package databases...\e[0m"

would be nicer. that way you don't have to do any coding and i don't
have to figure out the colors :)

udv / greetings,
VMiklos

-- 
Developer of Frugalware Linux, to make things frugal - http://frugalware.org




More information about the pacman-dev mailing list