[polyml] determining if an outstream is a tty