[Gllug] Changing the text colour at the command line
Nix
nix at esperi.demon.co.uk
Wed Dec 11 08:49:45 UTC 2002
On Tue, 10 Dec 2002, Tethys uttered the following:
>
> Nix writes:
>
>>On xterm, \033[0;39m should do the trick as well; that's `restore to
>>default', rather than changing to any specific colour.
>>
>>(That should be `CSI [0;39m', of course... ;} )
>
> tput op sgr0
>
> will do this in a terminal independent way.
Bit tough if you're trying to convince e.g. GNU grep's --color option to
do it; it unconditionally emits CSI[00m... (I've submitted a patch to
generalise it of course).
I hate broken terminal emulators.
--
`Ah, but don't you feel the jackboot of state oppression whenever you have
to deal with the uniformed storm-troopers of government bureaucracy, viz.
the bus company ticket inspectors?
Damn you for a Stalinist stooge!' --- Charlie Stross
--
Gllug mailing list - Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug
More information about the GLLUG
mailing list