rush / docs
Rush reads interactive configuration from Rush scripts.
Rush loads system and user configuration, then sources the file named by ENV for interactive startup.
/etc/rush/config.rush $XDG_CONFIG_HOME/rush/config.rush $HOME/.config/rush/config.rush $ENV
Define rush_prompt to build the interactive prompt.
rush_prompt() { prompt segment --fg blue "$(prompt_pwd)" prompt text ' $ ' }
The prompt command is only available while Rush is rendering the prompt.
prompt text TEXT... prompt segment [OPTIONS] TEXT... prompt newline
prompt text appends plain text. prompt segment appends styled text. prompt newline starts a new prompt line.
--fg COLOR --bg COLOR --bold --dim --italic --underline --blink --reverse --strikethrough
Colors may be named colors, 256-color indexes, or RGB hex values.
blue
bright-blue
index:236
'#7aa2f7'
prompt_pwd # current directory, with $HOME shortened to ~ prompt_duration # previous command duration
If rush_prompt is not defined, Rush uses PS1. Rush initializes PS1 to $ and PS2 to > for interactive shells.
PS1='rush$ ' PS2='> '
File: $HOME/.config/rush/config.rush
rush_prompt() { prompt segment --fg bright-blue "$(prompt_pwd)" if test "$(prompt_duration)" != ""; then prompt text ' ' prompt segment --dim "$(prompt_duration)" fi prompt text ' $ ' }
Configuration is early. Expect changes.