Run a subprocess in a pseudo terminal