PS1
Generate configurable colorful PS1 prompt generator for bash
Usage
1. Create a ~/.config/ps1.toml with the following content:
='{220}\u{137}:{220}{cwd:name}{37}{git:branch}{220}${reset}'
2. Add the following snippet to your .bashrc:
eval "$(~/.cargo/bin/ps1 --env)"
Syntax
ANSI Colors
{fg:number} or {number} where number is 0 - 255 - set foreground color
{bg:number} where number is 0 - 255 - set background color
{reset} reset colors
Current Work Dir Name
{cwd:name}
Git Branch
{git:branch}
How it works
Formal parsing of PS1 escape
sequences
and {custom:params} is done through the PEG grammar is defined at
src/grammar.pest