Starship Prompt Builder

Mercurial branch module

Shows the active branch and topic of the repo in your current directory

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
on  default 

Starting configuration

[hg_branch]
disabled = false
format = "on [$symbol$branch(:$topic)]($style) "
symbol = " "
style = "bold purple"
Open in the builder

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

Key options

symbolstring
The symbol used before the hg bookmark or branch name of the repo in your current directory.
stylestring
The style for the module.
formatstring
The format for the module.
truncation_lengthnumber
Truncates the hg branch / topic name to N graphemes
truncation_symbolstring
The symbol used to indicate a branch name was truncated.
disabledboolean
Disables the hg_branch module.

Format variables

$branch
The active mercurial branch
$style
Mirrors the value of option style
$symbol
Mirrors the value of option symbol
$topic
The active mercurial topic

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.