support pty pseudo terminal

I needed pty support for a reverse ssh problem. Solved it with your class and pty.