coloredstderr (0.2, 2014-06-22)

Last updated 2016-09-11

coloredstderr is a small library which uses LD_PRELOAD to color stderr. It “follows” dups, has minimal performance overhead and can ignore certain binaries (requires /proc).

Like all solutions using LD_PRELOAD it only works with dynamically linked binaries. Statically linked binaries, for example valgrind, are not supported. setuid binaries are also not supported (LD_PRELOAD disabled for security reasons).

Most other existing solutions use a second process which colors its input and pipe stderr to it. However this creates different runtime behaviour resulting in a different ordering of the output. Partial lines (no newline) also often cause problems. coloredstderr handles these cases correctly.

It was inspired by stderred [2]. Similar solutions (using LD_PRELOAD) include:

  • stderred [1], but doesn’t “follow” dups (I somehow missed it when looking for existing implementations)

  • stderred [2], but only hooks write()

coloredstderr is licensed under GPL 3 (or later).


  • C99 compiler (variable length arrays)

  • dynamic linker/loader which supports LD_PRELOAD (e.g. GNU/Linux’s or FreeBSD’s

Supported Systems

Tested on GNU/Linux, FreeBSD and Mac OS X (partial support). Should work on all POSIX systems which support LD_PRELOAD (with minor modifications).


Add the following settings to your shell configuration:


Also see README in tarball.


Current development happens in the git repository (also browsable as Gitweb):

git clone

Last updated 2016-09-11

Impressum Datenschutzerklärung