Default Theme
Preview
If there is nothing special about the current context, the appearance of Liquid Prompt is similar to that of a default prompt:
If you are running a background command and are also in the “main” branch of a Git repository on a server:
When Liquid Prompt is displaying nearly everything (a rare event!), it may look like this:
See Templates for what each section will look like.
Configuration
As the default theme, all of the normal Config Options are respected.
- LP_PS1_FILE: string = ""
A template file that is sourced for each prompt. Must set
LP_PS1
. See Templates for details.
- LP_PS1: string = ""
If set, the default theme sets
PS1
to this value. Not very useful to set it in the config, instead set it in theLP_PS1_FILE
.
Templates
The default theme supports templated sections. Each piece of the theme is saved to a variable, and can be arranged in any order in a template. If you want to change the theme enough to move things around, but not enough to make your own theme, templates will let you change the order of the default theme’s pieces.
As the default theme of Liquid Prompt was the only theme until version 2.0, templates were sometimes referred to as “themes” in version 1.X.
For a template file to be loaded, its filepath must be set in
LP_PS1_FILE
.
A template file does nothing more than set LP_PS1
to a value. The
following sections are available to be used.
An example template file is available: minimal.ps1.
Template Sections
All of the available template sections are listed below. Their order is the default order if the user does not configure a different template.
Note
Omitting a template section from your template will not disable that
feature. While it will not be displayed in the prompt, Liquid Prompt does not
know that, and will still generate that template section. If you want to
speed up your prompt by disabling a section, you must disable it with its
respective LP_ENABLE_*
option.
Not actually a part of the default theme, it is used in the default template as the starting section. See
LP_PS1_PREFIX
andprompt_tag()
for details.
- LP_TIME
The current time, displayed as either numeric values or as an analog clock, depending on the value of
LP_TIME_ANALOG
. SeeLP_ENABLE_TIME
.
- LP_BATT
The current battery status:
a green ⏚ (
LP_MARK_BATTERY
) if charging, above the given threshold, but not chargeda yellow ⏚ if charging and under the given threshold
a yellow ⌁ (
LP_MARK_ADAPTER
) if discharging but above the given thresholda red ⌁ if discharging and under the given threshold
And if
LP_PERCENTS_ALWAYS
is enabled, also the current battery percent. SeeLP_ENABLE_BATT
.
- LP_LOAD
The average of the processors load, displayed with an intensity color map as load increases. See
LP_ENABLE_LOAD
.
- LP_TEMP
The highest temperature of the available system sensors, displayed with an intensity color map as temperature increases. See
LP_ENABLE_TEMP
.
- LP_WIFI
The lowest wireless signal strength, displayed with an intensity color map as strength decreases. See
LP_ENABLE_WIFI_STRENGTH
.New in version 2.1.
- LP_JOBS
The number of detached sessions. See
LP_ENABLE_DETACHED_SESSIONS
.Also the number of running and sleeping shell jobs. See
LP_ENABLE_JOBS
.
- LP_BRACKET_OPEN
An opening bracket, designed to go around the core of the prompt (generally user, host, current working directory). See
LP_MARK_BRACKET_OPEN
.If running in a terminal multiplexer, will be colored. See
LP_COLOR_IN_MULTIPLEXER
.
- LP_USER
The current user, in bold yellow if it is root and in light white if it is not the same as the login user. See
LP_USER_ALWAYS
.
- LP_HOST
A green
@
if the connection has X11 support; a yellow one if not.The current host – in bold red if you are connected via a
telnet
connection and blue (or other unique colors) if connected via SSH. SeeLP_HOSTNAME_ALWAYS
.
- LP_PERM
A green colon (
LP_MARK_PERM
) if the user has write permissions in the current directory and a red one if not. SeeLP_ENABLE_PERM
.
- LP_PWD
The current working directory in bold, shortened if it takes too much space. See
LP_ENABLE_SHORTEN_PATH
.
- LP_DIRSTACK
The size of the directory stack, prefixed with
LP_MARK_DIRSTACK
, all colored withLP_COLOR_DIRSTACK
. Can be enabled byLP_ENABLE_DIRSTACK
.New in version 2.0.
- LP_BRACKET_CLOSE
A closing bracket, designed to go around the core of the prompt (generally user, host, current working directory). See
LP_MARK_BRACKET_CLOSE
.If running in a terminal multiplexer, will be colored. See
LP_COLOR_IN_MULTIPLEXER
.
- LP_PROXY
A ↥ (
LP_MARK_PROXY
) if an HTTP proxy is in use. SeeLP_ENABLE_PROXY
.
- LP_ENVVARS
Some user-defined environment variable’s states. Watched variables should be defined in the
LP_ENV_VARS
array.Set variables are displayed in bold blue, unset variables in blue. See also
LP_ENABLE_ENV_VARS
.New in version 2.2.
- LP_SHLVL
The number of nested shells, prefixed with
LP_MARK_SHLVL
, all colored withLP_COLOR_SHLVL
. Can be disabled byLP_ENABLE_SHLVL
.New in version 2.1.
- LP_DEV_ENV
Sections related to development environments (see section dev_env below).
See also
LP_MARK_DEV_OPEN
,LP_MARK_DEV_MID
, andLP_MARK_DEV_CLOSE
.New in version 2.2.
- LP_VCS
The name of the current branch if you are in a version control repository (Git, Mercurial, Subversion, Bazaar, or Fossil):
in green if everything is up-to-date
in red if there are changes
in yellow if there are pending commits to push
The number of added/deleted lines if changes have been made and the number of pending commits
The number of commits ahead/behind the remote tracking branch
A yellow + (
LP_MARK_STASH
) if there are stashed modificationsa red * (
LP_MARK_UNTRACKED
) if there are untracked files in the repository
- LP_RUNTIME
The runtime of the last command, if it has exceeded a certain threshold. See
LP_ENABLE_RUNTIME
.
- LP_ERR
The error code of the last command, if it is non-zero. See
LP_ENABLE_ERROR
.
- LP_ERR_MEANING
A guess on the meaning of the last error. See
LP_ENABLE_ERROR_MEANING
andLP_ERR
.New in version 2.2.
Not actually a part of the default theme, it is used in the default template as the last thing before the prompt mark. See
LP_MARK_PREFIX
for details.
Bold normally, red if you have
sudo
rights or for the root user.Separate from
LP_MARK
for historical reasons.
- LP_MARK
A smart mark at the end of the prompt:
$ or % (
LP_MARK_DEFAULT
) for a simple user# for the root user
⌘ (
LP_MARK_FOSSIL
) for Fossil± (
LP_MARK_GIT
) for Git☿ (
LP_MARK_HG
) for Mercurial‡ (
LP_MARK_SVN
) for Subversion‡± for Git-Subversion
|±| (
LP_MARK_VCSH
) for VCSH
Not actually a part of the default theme, it is used in the default template as the final section. See
LP_PS1_POSTFIX
for details.
Development environment sections
Version 2.2 of Liquid Prompt introduced a new way to display all sections
related to development environments.
All the data below are now items in the LP_DEV_ENV
list,
joined by LP_MARK_DEV_MID
and surrounded by
LP_MARK_DEV_OPEN
and LP_MARK_DEV_CLOSE
.
If you want to change the ordering or have different marks for different items, you can derive your own theme template and use the following sections.
- LP_SCLS
The current Red Hat Software Collections environment. See
LP_ENABLE_SCLS
.
- LP_AWS_PROFILE
The current active AWS Profile. See
LP_ENABLE_AWS_PROFILE
.New in version 2.1.
- LP_CONTAINER
The container status for the current shell. See
LP_ENABLE_CONTAINER
.New in version 2.1.
- LP_VENV
The current Python (or Conda) virtual environment. See
LP_ENABLE_VIRTUALENV
.
- LP_NODE_VENV
The current Node.js virtual environment. See
LP_ENABLE_NODE_VENV
.New in version 2.1.
- LP_PERL_VENV
The current Perl virtual environment. See
LP_ENABLE_PERL_VENV
.New in version 2.2.
- LP_RUBY_VENV
The current Ruby virtual environment. See
LP_ENABLE_RUBY_VENV
.New in version 2.1.
- LP_TFSPACE
The current Terraform workspace. See
LP_ENABLE_TERRAFORM
.New in version 2.1.
- LP_KUBECONTEXT
The current Kubernetes context. See
LP_ENABLE_KUBECONTEXT
.New in version 2.1.
- LP_CMAKE
Variables from CMake cache configured in this directory:
the base name of the compiler (without the path),
the configured generator (without spaces, some of them shortened),
the build type.
See
LP_ENABLE_CMAKE
.New in version 2.2.