Do not fork, open a new pty pair and use spawn() to attach the descriptors.