~ashn/setup

79e02220f1db2afcd24b4455a0e309eb941e4370 — ashn 1 year, 7 months ago bc04d46
Update PS1 in .shrc
1 files changed, 10 insertions(+), 3 deletions(-)

M dotfiles/.shrc
M dotfiles/.shrc => dotfiles/.shrc +10 -3
@@ 21,8 21,7 @@ alias gdbt='gdb --tui'


## CUSTOM PS1
git_ps1()
{
git_ps1() {
    GIT_BRANCH=$(git branch 2> /dev/null | grep '^\* ' | sed -e 's/^\* //g')
    if [ -z "${GIT_BRANCH}" ]; then
        echo ''


@@ 59,5 58,13 @@ git_ps1()
        echo "[${GIT_BRANCH}]"
    fi
}
ps1() {
    if [ -z "$BASH_VERSION" ]; then
        echo "$(pwd)$ "
        return 0
    fi
    echo "\w\[\e[33m\]\`git_ps1\`\[\e[m\]\\$ "
}

export git_ps1
export PS1="\w\[\e[33m\]\`git_ps1\`\[\e[m\]\\$ "
export PS1="$(ps1)"