Created
July 14, 2022 22:32
-
-
Save rodrigondec/f26d0fe3a364af107fc231dc56456d96 to your computer and use it in GitHub Desktop.
Revisions
-
rodrigondec created this gist
Jul 14, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash/13864829#13864829 # https://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html # https://stackoverflow.com/a/5947802 # https://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/ git_branch() { branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null) BEGIN_CYAN='\033[0;36m' END_CYAN='\033[0m' if [ -z "$branch" ] then echo "" else echo -e " ${BEGIN_CYAN}{$branch}${END_CYAN} " fi } export PS1="\[\e]0;\u: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$(git_branch)\$ "