Document and detect EOF condition in interact()