Created
September 6, 2016 14:45
-
-
Save evertontrindade/125b00aeb99470ae6bb9f5ca4b0cefdc to your computer and use it in GitHub Desktop.
change view id terminal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Script para modificar a exibição do identificador no terminal | |
# Este script deve ser adicionado ao final do arquivo .bashrc do usuario | |
# após modificar executar o "source .bashrc" para que seja atualizada a exibição | |
# O padrão de exibição será: <USUARIO>@<NOME_DA_MAQUINA>:<DIRETORIO_CORRENTE> [<BRANCH_DO_GIT>] | |
## | |
function git_branch_name() { | |
git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/ [\1] /' | |
} | |
function show_colored_git_branch_in_prompt() { | |
PS1="\[\033[01;32m\]\u@\h:\[\033[01;34m\]\W\[\033[31m\]\$(git_branch_name)\[\033[m\]$ " | |
} | |
show_colored_git_branch_in_prompt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment