MySQL Shell 8.0  /  Customizing MySQL Shell  /  Customizing the Prompt

7.3 Customizing the Prompt

The prompt of MySQL Shell can be customized using prompt theme files. To customze the prompt theme file, either set the MYSQLSH_PROMPT_THEME environment variable to a prompt theme file name, or copy a theme file to the ~/.mysqlsh/prompt.json directory on Linux and Mac, or the %AppData%\MySQL\mysqlsh\prompt.json directory on Windows.

The user configuration path for the directory can be overridden on all platforms by defining the environment variable MYSQL_USER_CONFIG_HOME. The value of this variable replaces %AppData%\MySQL\mysqlsh\ on Windows or ~/.mysqlsh/ on Unix.

The format of the prompt theme file is described in the README.prompt file, and some sample prompt theme files are included. Some of the sample prompt theme files require a special font (for example SourceCodePro+Powerline+Awesome+Regular.ttf), or support from the terminal for color display. Most terminals support 256 colors in Linux and Mac. In Windows, color support requires either a 3rd party terminal program with support for ANSI/VT100 escapes, or Windows 10. On startup, if an error is found in the prompt theme file, an error message is printed and a default prompt theme is used.