Skip to content
Snippets Groups Projects
Commit 827aa3d7 authored by Juntong Liu's avatar Juntong Liu
Browse files

Keep user's shell prompt string if it exists

parent 2d3796f5
No related branches found
No related tags found
1 merge request!40E3-341: Improve the shell prompt to display e3 info
...@@ -354,5 +354,18 @@ echo "##############################################" ...@@ -354,5 +354,18 @@ echo "##############################################"
echo echo
BASE_version=$(echo "${EPICS_BASE##*/}" | awk -F '-' '{print $2}') BASE_version=$(echo "${EPICS_BASE##*/}" | awk -F '-' '{print $2}')
E3_ENV_INFO="{B:$BASE_version R:$E3_REQUIRE_VERSION}"
NEW_E3_PS="${E3_ENV_INFO}\[\033[33m\]\u\[\033[m\]@\[\033[33;1m\]\w\[\033[m\]\$ "
export PS1="\[\033[33m\]\u\[\033[m\] @ Base:$BASE_version Req:$E3_REQUIRE_VERSION \[\033[33;1m\] \w\[\033[m\]\$ " if [ -z "$E3_ENV_ON" ]; then
if [ -z "$PS1" ]; then
export E3_ENV_ON="ON"
export PS1="${NEW_E3_PS}"
else
export E3_ENV_ON="ON"
export PS1="${E3_ENV_INFO}${PS1}"
fi
else
PS_TMP=${PS1/\{*\}/}
export PS1="${E3_ENV_INFO}${PS_TMP}"
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment