sg: Capture stdout/stderr and print on error
Created by: mrnugget
This captures the output of every command in a ring-buffer-like data structure so that we can save 2*32kb of output per command and print stdout/stderr when a command fails. That makes it easier to spot what went wrong if there was a lot of output from other commands before.
Before:
After: