aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
authorMazen Harake <[email protected]>2016-07-18 11:37:59 +0200
committerMazen Harake <[email protected]>2016-07-18 12:00:14 +0200
commit759f73f59879a40279c7b5229e40d21f2c42231e (patch)
treef0d433f3fd4cee093cad7ae3cd4f66c612508a20 /kerl
parentf945409f2be7a13e714a6b99853f9f3e2f8fddad (diff)
downloadkerl-759f73f59879a40279c7b5229e40d21f2c42231e.tar.gz
kerl-759f73f59879a40279c7b5229e40d21f2c42231e.tar.bz2
kerl-759f73f59879a40279c7b5229e40d21f2c42231e.zip
Add support for customized prompt for activated installations
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl10
1 files changed, 9 insertions, 1 deletions
diff --git a/kerl b/kerl
index e5f6c76..72077a0 100755
--- a/kerl
+++ b/kerl
@@ -665,6 +665,8 @@ kerl_deactivate()
if [ ! "\$1" = "nondestructive" ]; then
unset -f kerl_deactivate
fi
+ unset KERL_ENABLE_PROMPT
+ unset KERL_PROMPT_FORMAT
}
kerl_deactivate nondestructive
@@ -684,7 +686,13 @@ if [ -f "$KERL_CONFIG" ]; then . "$KERL_CONFIG"; fi
if [ -n "\$KERL_ENABLE_PROMPT" ]; then
_KERL_SAVED_PS1="\$PS1"
export _KERL_SAVED_PS1
- PS1="($1)\$PS1"
+ if [ -n "\$KERL_PROMPT_FORMAT" ]; then
+ FRMT="\$KERL_PROMPT_FORMAT"
+ else
+ FRMT="(%BUILDNAME%)"
+ fi
+ PROMPT=\$(echo "\$FRMT" | sed 's^%RELEASE%^$rel^;s^%BUILDNAME%^$1^')
+ PS1="\$PROMPT\$PS1"
export PS1
fi
if [ -n "\$BASH" -o -n "\$ZSH_VERSION" ]; then