2.5 Using a Pager

You can configure MySQL Shell to use an external pager tool such as less or more. Once a pager is configured, it is used by MySQL Shell to display the text from the online help or the results of SQL operations. Use the following configuration possibilities:

  • Configure the shell.options[pager] = "" MySQL Shell option, a string which specifies the external command that displays the paged output. This string can can optionally contain command line arguments which are passed to the external pager command. Correctness of the new value is not checked. An empty string disables the pager.

    Default value: empty string.

  • Configure the PAGER environment variable, which overrides the default value of shell.options["pager"] option. If shell.options["pager"] was persisted, it takes precedence over the PAGER environment variable.

    The PAGER environment variable is commonly used on Unix systems in the same context as expected by MySQL Shell, conflicts are not possible.

  • Configure the --pager MySQL Shell option, which overrides the initial value of shell.options["pager"] option even if it was persisted and PAGER environment variable is configured.

  • Use the \pager | \P command MySQL Shell command to set the value of shell.options["pager"] option. If called with no arguments, restores the initial value of shell.options["pager"] option (the one MySQL Shell had at startup. Strings can be marked with " characters or not. For example, to configure the pager:

    • pass in no command or an empty string to restore the initial pager

    • pass in more to configure MySQL Shell to use the more command as the pager

    • pass in more -10 to configure MySQL Shell to use the more command as the pager with the option -10