Created
May 5, 2015 06:51
-
-
Save adamchalmers/473830e7e1851166f709 to your computer and use it in GitHub Desktop.
Basic colored prompt for 1103 students
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 characters
TERM=xterm-256color | |
export PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"' | |
# using tput commands | |
FGBLK=$( tput setaf 0 ) # 000000 | |
FGRED=$( tput setaf 1 ) # ff0000 | |
FGGRN=$( tput setaf 2 ) # 00ff00 | |
FGYLO=$( tput setaf 3 ) # ffff00 | |
FGBLU=$( tput setaf 4 ) # 0000ff | |
FGMAG=$( tput setaf 5 ) # ff00ff | |
FGCYN=$( tput setaf 6 ) # 00ffff | |
FGWHT=$( tput setaf 7 ) # ffffff | |
RESET=$( tput sgr0 ) | |
export PS1="\[$FGGRN\][\u \[$FGBLU\] \W\[$FGRED\]\[$FGGRN\]]\$ \[$RESET\]" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment