From 2e3ffcfe0c9879d759324d06868d9e669cb9c36c Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Sun, 1 Sep 2024 20:33:45 +0200 Subject: [PATCH] Remove color_prompt configurationg --- .bashrc | 39 ++++----------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/.bashrc b/.bashrc index d66c9fd..5120b52 100644 --- a/.bashrc +++ b/.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