Remove color_prompt configurationg
This commit is contained in:
parent
846ceeca02
commit
2e3ffcfe0c
1 changed files with 4 additions and 35 deletions
39
.bashrc
39
.bashrc
|
|
@ -24,43 +24,12 @@ shopt -s checkwinsize
|
|||
# make less more friendly for non-text input files, see lesspipe(1)
|
||||
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
|
||||
|
||||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color|*-256color|alacritty|wezterm) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
# uncomment for a colored prompt, if the terminal has the capability; turned
|
||||
# off by default to not distract the user: the focus in a terminal window
|
||||
# should be on the output of commands, not on the prompt
|
||||
#force_color_prompt=yes
|
||||
# set the prompt colors
|
||||
bold=$(tput bold)
|
||||
reset=$(tput sgr0)
|
||||
|
||||
if [ "$force_color_prompt" == "yes" ] && [ -z "$color_prompt" ]; then
|
||||
if [ -x /usr/bin/tput ] && tput setf 1 >&/dev/null; then
|
||||
# We have color support; assume it's compliant with Ecma-48
|
||||
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
|
||||
# a case would tend to support setf rather than setaf.)
|
||||
color_prompt=yes
|
||||
elif [ -e /usr/share/terminfo/x/xterm+256color ]; then
|
||||
color_prompt=yes
|
||||
else
|
||||
color_prompt=
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PS1="\[\033[1;35m\]\u\[\033[1;34m\]@\[\033[0;34m\]\h \[\033[1;34m\]\w\\[\033[0;30m\]$ "
|
||||
|
||||
else
|
||||
PS1='\u@\h:\w\$ '
|
||||
fi
|
||||
|
||||
# Show different prompt when root
|
||||
if [ $(id -u) -eq 0 ];
|
||||
then
|
||||
PS1="\[\033[1;33m\]\u\[\033[1;34m\]@\[\033[1;32m\]\h \[\033[1;34m\]\w\\[\033[0;37m\]# "
|
||||
fi
|
||||
|
||||
unset color_prompt force_color_prompt
|
||||
PS1="\u@\[$bold\]\h\[$reset\]:\w \$ "
|
||||
|
||||
# enable color support of ls and also add handy aliases
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue