#!/bin/sh
# detach — run a command fully free of the terminal.
# New session, stdio discarded, parent can exit immediately.
#
# Usage: detach brave [args...]
#        detach gimp ~/pic.png

if [ "$#" -eq 0 ]; then
	echo "usage: detach <command> [args...]" >&2
	exit 1
fi

setsid "$@" </dev/null >/dev/null 2>&1 &
