Switched to pty.fork() instead of manual pty