add pty support