make_prompt_rs/source.sh

11 lines
223 B
Bash

bin_path=$(pwd)/target/debug/make_prompt
PROMPT_COMMAND='make_prompt'
make_prompt () {
local lastexit=$?
local bgjobs=$(jobs | wc -l)
local prompt_pref=$($bin_path $lastexit $bgjobs)
PS1="$prompt_pref"
}