Last active
June 25, 2020 04:48
-
-
Save ultimaweapon/be9878b1c3dead272726e1106edaac86 to your computer and use it in GitHub Desktop.
My Bash configurations
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
alias ls='ls --color=auto' | |
alias ll='ls -hl --group-directories-first' | |
PROMPT_COMMAND=setup_prompt | |
setup_prompt() { | |
exit_code="$?" | |
PS1="[\[\e[1;34m\]\w\[\e[0m\]:\[\e[1;95m\]${exit_code}\[\e[0m\]]" | |
if test "$exit_code" != "0"; then | |
PS1+="\[\e[1;31m\]\$\[\e[0m\] " | |
else | |
PS1+="\[\e[1;32m\]\$\[\e[0m\] " | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment