Skip to content

Instantly share code, notes, and snippets.

@jmurowaniecki
Last active September 21, 2017 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmurowaniecki/8e48fa4bd605d5974980d8fc4031a207 to your computer and use it in GitHub Desktop.
Save jmurowaniecki/8e48fa4bd605d5974980d8fc4031a207 to your computer and use it in GitHub Desktop.
Meu terminal
#!/usr/sbin/env bash
function git-branch-name
{
branch=$(git symbolic-ref HEAD 2>/dev/null | awk -F/ {'print $NF'})
dirty=1
[[ "${branch}" == "" ]] && return
[[ "$(git status 2> /dev/null | grep 'nothing to commit')" != "" ]] && \
dirty=0
cols=$(expr $COLUMNS - ${#branch} - 5)
echo -en "\e[0;45m ⎇ \e[${dirty};45m ${branch} \e[0;0m"
}
PS1='${debian_chroot:+($debian_chroot)}\[$(git-branch-name)\]\[\e[0m\]\e[m 🗲 \u\[\e[0m\]\[\e[2m in \e[0m\]\[\e[0;1m\]\w\[\e[0m\]/'
@githubnando
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment