The behaviour of these functions is affected by settings in php.ini.
Here's a short explanation of the configuration directives.
cli.pager
External tool to display output from command line.
cli.prompt
Command line prompt.