add pty echo support