#!/usr/bin/env bash
# tools/blastem [args...]: BlastEm (blastem-cw.nix, or $BLASTEM) with its stdin and stderr on a
# pseudo-terminal (util-linux's script). When they aren't terminals (a log file, a test), BlastEm
# turns every warning into a message box ("Failed to set vsync to off" under Xvfb's llvmpipe, for
# one), and nixpkgs' SDL shows it with zenity, which waits for a click forever on a headless display.
# On a terminal BlastEm prints them instead. The output (BlastEm's stdout + stderr) is this script's.
exec script -qefc "$(printf '%q ' "${BLASTEM:-blastem}" "$@")" /dev/null < /dev/null
