+# The first part of the prompt is user@host where host is highlighted in
+# green if the last command exited 0 or in red otherwise.
+# This part will be shown only if __ps1_user is 1. By default it is 1.
+# The success and failure colours can be changed by modifying
+# $PROMPT_OK_COLOUR and $PROMPT_FAILED_COLOUR respectively.
+#
+# Subsequent parts are taken from *.ps1 files in the .ps1.d directory.
+# Each file <plugin>.ps1 should contain:
+# * A line __ps1_<plugin>=${__ps1_<plugin>:-X} where X is 0 or 1 to activate
+# the plugin by default (or not).
+# * A function __ps1_<plugin>() which returns the text to be displayed.
+# The function will be passed the return code of the last command as its
+# first argument and should return the same code.
+# The function should print nothing unless __ps1_<plugin> is 1.
+# The function should call "__ps1_prefix $1 __ps1_<plugin>" to retrieve a
+# prefix string. When the string is non-empty, it should be printed before
+# any output from the plugin itself. Doing so will ensure that the text is
+# formatted correctly regardless of whether other parts of the prompt are
+# being shown.
+# * One to three lines __ps1_<plugin>_colour256, __ps1_<plugin>_colour88 and
+# __ps1_<plugin>_colour setting the colour for the plugin.
+# The plugin should not emit ANSI colour sequences itself. PS1 needs to wrap
+# all escape sequences with the literal strings \[ and \] but these must be
+# embedded directly into the prompt and not evaluated programmatically.
+# Omitting them will cause the terminal to redraw incorrectly under certain
+# circumstances. Trying to include them in a function will not work.
+# Instead the plugin should define at least __ps1_<plugin>_colour. The
+# colour will be generated before any text from the plugin is printed.
+# To handle 88- and 256-colour terminals, the plugin may also declare
+# __ps1_<plugin>_colour88 and/or __ps1_<plugin>_colour256.
+#
+# Example plugin code:
+#
+# __ps1_example_colour='0;33'
+#
+# function __ps1_example() {
+# if [ -n "$__ps1_example" ]; then
+# echo -n "$(__ps1_prefix $1 __ps1_example)"
+# echo -n "example!"
+# fi
+# return $1
+# }
+#
+# The next part of the prompt is the exit status of the last command.
+# This part will be shown only if __ps1_user is set and the exit status is
+# non-zero.
+#
+# The penultimate part of the prompt is the number of background jobs managed
+# by the shell, in square brackets. If all background jobs are running,
+# their number will be shown as [n]. If some are stopped, the number of
+# running (r) and total (t) jobs will be shown as [r/t].
+# This part will be shown only if __ps1_bg is 1. By default it is 0.
+
+# The final part of the prompt is the (full) working directory and $ string.
+# If the shell is running as root the # string's colour can be changed by
+# modifying $ROOT_OK_COLOUR and $ROOT_FAILED_COLOUR.