Prompt themes
grfsh draws its own prompt. Run configure-prompt for a short wizard with live previews, or pick a preset directly:
configure-prompt --listconfigure-prompt --preset rainbowBoth write ~/.config/grfsh/theme, a plain key = value file. Edit it by hand any time; the next prompt picks up the change.
The theme file
Section titled “The theme file”preset = lean # start from a preset, then overridestyle = classic # lean, classic or rainbowicons = nerd # nerd, unicode or asciilines = 2 # 1 or 2transient = true # collapse old prompts to a single characterleft = context dir gitright = status duration jobs venv rust node python go timeprompt_char = "❯"dir_depth = 3 # how many trailing directories to showduration_threshold = 2 # seconds before duration appearscontext_always = false # show user@host even on local sessionscolor.dir = #61afefcolor.git = 178A # starts a comment when it follows a space, so colors such as #ff8800 work.
Styles
Section titled “Styles”- lean prints segments separated by spaces, with colored text and no backgrounds.
- classic puts segments on a dark bar with thin separators.
- rainbow gives each segment its own background with powerline arrows. It needs a Nerd Font.
Segments
Section titled “Segments”Segments only show when they have something to say.
| Segment | Shows |
|---|---|
context |
user@host, on SSH, as root, or with context_always = true |
dir |
the working directory, shortened to dir_depth parts |
git |
branch, a dirty marker, and ahead and behind counts |
status |
the exit status after a failure |
duration |
how long the last command took, past duration_threshold |
jobs |
the number of background jobs |
time |
the current time |
venv |
the active Python virtual environment |
rust, node, python, go |
the toolchain version inside a project of that kind |
Colors
Section titled “Colors”A color is a name (red, blue, magenta and the others), a number from 0 to 255, or a hex value such as #61afef. Hex colors use 24 bit escapes when COLORTERM is truecolor or 24bit and the nearest 256 color otherwise. With NO_COLOR set, the prompt has no colors at all.
nerd uses Nerd Font glyphs, unicode uses characters every modern font has, and ascii is safe for any terminal. grfsh falls back to ascii when the locale is not UTF-8.
Right and transient prompts
Section titled “Right and transient prompts”The right prompt lines up at the edge of the terminal and disappears when the line gets long. With transient = true, a prompt shrinks to its final character once you press Enter, so the scrollback stays clean.
starship
Section titled “starship”If you already use starship, set engine = starship in the theme file and grfsh calls it to draw the prompt.
Without a theme file
Section titled “Without a theme file”When there is no theme file, GRFSH_THEME=name picks a preset and GRFSH_PROMPT sets a template for the simple default prompt:
export GRFSH_PROMPT='{blue}{cwd}{reset} {git}{red}{status}{reset}> 'Placeholders: {user}, {host}, {cwd}, {branch}, {dirty}, {git}, {status}, {duration}, {jobs}, and the colors {green}, {blue}, {magenta}, {cyan}, {red}, {yellow}, {bold}, {reset}.