Starship Prompt Builder

Status module

Shows the exit code of the previous command

When it appears

This module is disabled by default. Enable it, then it renders when Starship detects the matching context.

Preview

Rendered from the starting configuration in a representative simulated environment.

starship — preview
❌130 

Starting configuration

[status]
disabled = false
format = "[$symbol$status]($style) "
symbol = "❌"
style = "bold red"
Open in the builder

The configuration is compressed into the URL fragment and stays in your browser.

Key options

formatstring
The format of the module
symbolstring
The symbol displayed on program error
success_symbolstring
The symbol displayed on program success
not_executable_symbolstring
The symbol displayed when file isn't executable
not_found_symbolstring
The symbol displayed when the command can't be found
sigint_symbolstring
The symbol displayed on SIGINT (Ctrl + c)
signal_symbolstring
The symbol displayed on any signal
stylestring
The style for the module.
success_stylestring
The style used on program success (defaults to style if unset).
failure_stylestring
The style used on program failure (defaults to style if unset).
map_symbolboolean
Enable symbols mapping from exit code
recognize_signal_codeboolean
Enable signal mapping from exit code
pipestatusboolean
Enable pipestatus reporting
pipestatus_separatorstring
The symbol used to separate pipestatus segments (supports formatting)
pipestatus_formatstring
The format of the module when the command is a pipeline
pipestatus_segment_formatstring
When specified, replaces format when formatting pipestatus segments
disabledboolean
Disables the status module.

Format variables

$common_meaning
Meaning of the code if not a signal
$hex_status
The exit code of the last command in hex
$int
The exit code of the last command
$maybe_int
Contains the exit code number when no meaning has been found
$pipestatus
Rendering of in pipeline programs' exit codes, this is only available in pipestatus_format
$signal_name
Name of the signal corresponding to the exit code, only if signalled
$signal_number
Signal number corresponding to the exit code, only if signalled
$status
The exit code of the last command
$style
Mirrors the value of option success_style on program success and failure_style otherwise
$symbol
Mirrors the value of option symbol

Common adjustments

  • Edit format to reorder its variables or make surrounding text conditional.
  • Adjust its style options to fit the palette used by the rest of the prompt.