Skip to content

Commit

Permalink
more readable $PS1 coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
parsapoorsh committed May 27, 2024
1 parent 070ff3d commit 5c13055
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,21 @@ if [ -n "$force_color_prompt" ]; then
fi

if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
SC_COLOR_OFF="$(tput sgr0)"

SC_BOLD="$(tput bold)"
SC_UNDERLINE="$(tput smul)"

SC_BLACK="$(tput setaf 0)"
SC_RED="$(tput setaf 1)"
SC_GREEN="$(tput setaf 2)"
SC_YELLOW="$(tput setaf 3)"
SC_BLUE="$(tput setaf 4)"
SC_PURPLE="$(tput setaf 5)"
SC_CYAN="$(tput setaf 6)"
SC_WHITE="$(tput setaf 7)"

PS1='${debian_chroot:+($debian_chroot)}\[$SC_BOLD$SC_GREEN\]\u@\h\[$SC_COLOR_OFF\]:\[$SC_BOLD$SC_BLUE\]\w\[$SC_COLOR_OFF\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
Expand Down

0 comments on commit 5c13055

Please sign in to comment.