playpty Play script in pty This is only tested in democtl Maybe it can be used in other places, but it is not guaranteed.