SWick

Sysadmin-by-Nature

My New Shell Prompt
14th November 2022

User

export PROMPT_DIRTRIM=2

git_branch() {

  BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')

  [[ ! -z $BRANCH ]] && echo "[${BRANCH}] "

}

PS1='\n \w \[\e[33;1;12m\]$(git_branch)\[\033[0m\][\[\033[0;96m\]>\[\033[0m\]] '

root

export PROMPT_DIRTRIM=2

git_branch() {

  BRANCH=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')

  [[ ! -z $BRANCH ]] && echo "[${BRANCH}] "

}

PS1='\n \w \[\e[33;1;12m\]$(git_branch)\[\033[0m\][\[\033[0;91m\]>\[\033[0m\]] '

"People said I should accept the world. Bullshit! I don't accept the world." -- Stallman