Back to Oh My Posh

Secondary prompt

website/docs/configuration/secondary-prompt.mdx

29.13.02.2 KB
Original Source

import Config from "@site/src/components/Config.js";

:::info This feature only works in powershell, zsh and bash for the time being. :::

The secondary prompt is displayed when a command text spans multiple lines. The default is > .

You can use go text/template templates extended with sprig to enrich the text. Environment variables are available, just like the console_title_template functionality.

Configuration

You need to extend or create a custom theme with your secondary prompt override. For example:

<Config data={{ secondary_prompt: { background: "transparent", foreground: "#ffffff", template: "-> ", }, }} />

Options

NameTypeDescription
backgroundstringcolor
foregroundstringcolor
templatestringa go text/template template extended with sprig utilizing the properties below - defaults to >

Template (info)

NameTypeDescription
.Rootbooleanis the current user root/admin or not
.Shellstringthe current shell name
.UserNamestringthe current user name
.HostNamestringthe host name