Read this:
There is no terminal.available, and terminal.print isn’t designed to be used in that way.
Pete.