Make direnv prompt updating conditional to direnv's presence
This commit is contained in:
parent
772da66b96
commit
edd3b72430
@ -29,6 +29,7 @@ if [ "${HOSTNAME}" != "crypt" ] && [ "${HOSTNAME}" != "tomb" ] || [ "${SSH_TTY}"
|
||||
fi
|
||||
export ORIG_PS1=${PS1}
|
||||
|
||||
if which direnv &> /dev/null; then
|
||||
update_prompt() {
|
||||
if direnv status | grep -iq 'RC allowed true'; then
|
||||
PS1=${DIRENV_PS1}
|
||||
@ -37,6 +38,7 @@ update_prompt() {
|
||||
fi
|
||||
}
|
||||
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