It seems that the correct way to read user input in prolog is to use phrase_from_stream, providing stdin as the stream. How in Scryer Prolog does one bind a variable to the stdin stream in order to do this? i.e. I want to do something like
stdin(Input),
phrase_from_stream(my_phrase(X), Input).
Try the ISO predicate current_input(-Stream).