Make direnv prompt updating conditional to direnv's presence
This commit is contained in:
parent
97a4f9fa91
commit
4ef1d15958
@ -29,14 +29,16 @@ if [ "${HOSTNAME}" != "crypt" ] && [ "${HOSTNAME}" != "tomb" ] || [ "${SSH_TTY}"
|
||||
fi
|
||||
export ORIG_PS1=${PS1}
|
||||
|
||||
update_prompt() {
|
||||
if which direnv &> /dev/null; then
|
||||
update_prompt() {
|
||||
if direnv status | grep -iq 'RC allowed true'; then
|
||||
PS1=${DIRENV_PS1}
|
||||
else
|
||||
PS1=${ORIG_PS1}
|
||||
fi
|
||||
}
|
||||
PROMPT_COMMAND="update_prompt; $PROMPT_COMMAND"
|
||||
}
|
||||
PROMPT_COMMAND="update_prompt; $PROMPT_COMMAND"
|
||||
fi
|
||||
|
||||
# Continuation Prompt: "> " in cyan
|
||||
export PS2="${cyan}>${no_color} "
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user