Patch also fixes NetBSD and OpenBSD, but I can't test that. <pty.h> is <util.h> on some BSDs.
tox_shell is a basic secure shell that can be used to control a computer from any Tox client. Just run tox_shell and make it add your Tox id. It's very basic but it works.