Have you ever wanted to more easily distinguish between stderr and stdout when running a terminal command? Maybe wanted stderr to be colored red and stdout to be normal?

Well, here's a very simple C program that does that for you.

Here's how it can be download, installed, and used:


rederr --help
Usage: rederr [-h|--help] CMD [ARG] ...

    Runs CMD with stdout like this and stderr like this.

Version: 1.0.0

Environment variables:
        bytes to write before stdout; default: ""
        bytes to write after stdout; default: ""
        bytes to write before stderr; default: "\e[31m" (foreground red)
        bytes to write after stderr; default: "\e[0m" (reset)

    CMD is launched with stdout and stderr as a pipe, not a virtual tty.

    If stderr and stdout are written close together, output may be out of order.

    rederr only adds additional output to stdout/stderr for formatting,
    if CMD emits ANSI escape codes, they will be present in the output.

    rederr exits with 111 in case of an internal errors.


Binary builds of rederr can be found at: and Both are identical and have a SHA-256 checksum of 4047fd8848875f9441fc22bd6bb674c273d68ddd10a9d800d6cd80fdf50239bd.

These are αcτµαlly pδrταblε εxεcµταblε builds built with cosmopolitan libc, which means they are fat binary executables that run on practically any platform: Linux + Mac + Windows + FreeBSD + OpenBSD + NetBSD + BIOS on AMD64 and ARM64.

End up using this on a non-Linux/Mac/Windows platform? Please reach out and let me know.

Source Code

The source code can be found here:

To build it yourself, run make. You can set the CC environment variable to specify your compiler of choice.


In my day to day work, I pretty much live in a commandline terminal. I think there are a whole bunch of missing small tools meant to improve the day to day quality of life if you work in the commandline.

This is one of those tools, I'll be making more.

A few things to keep in mind about rederr:

  • It is simple, all it does and will ever do is wrap chunks written to stdout / stderr with a prefix and suffix.
  • It is only configurable through environment variables.
  • It works best with programs that don't emit ANSI terminal color escape codes at all if they are not writing to a terminal.
  • If the underlying program writes data nearly simultaneously to stdout and stderr, it's possible that rederr will change the order of those writes.

Shout-out to Ben for the idea, thanks!