[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Font color selection in MATE terminal



On 23/6/21 1:42 am, Greg Wooledge wrote:
On Wed, Jun 23, 2021 at 12:27:17AM +0800, Bret Busby wrote:
And, that also applies, if provision for coloured text is commented out, in
the .bashrc file.

There's nothing in .bashrc which controls the terminal's interpretation
of color escape sequences.  Or in bash, anywhere.

It's entirely between the terminal, and the application which generates
the color sequences.  The shell is not involved.

The closest the shell comes to being involved is if you try to trick the
application into thinking it's on a different kind of terminal, by
changing the TERM variable.  This rarely works out well, except in
very specific circumstances -- the most notable being "I'm ssh-ing to
a system that doesn't know about my terminal type".

As I've already tested today, it sure as hell doesn't work for apt(8).


Excerpt from .bashrc file:

"

# set a fancy prompt (non-color, unless we know we "want" color)
# case "$TERM" in
#    xterm-color|*-256color) 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

# if [ -n "$force_color_prompt" ]; then
#    if [ -x /usr/bin/tput ] && tput setaf 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
 #   else
 # next line commented out by me to prevent colouring of prompt
 #	color_prompt=
#    fi
# fi

# if [ "$color_prompt" = yes ]; then
# PS1='[\D{} \t] ${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
#   PS1="\d \t \u@\h:\w$"
# else
   PS1='[\D{} \t] ${debian_chroot:+($debian_chroot)} `date `\u@\h:\w\$ '
# PS1="\d \t \u@\h:\w$"
# fi
# unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
# PS1="[\D{} \t] \[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: `date `\w\a\]$PS1"
PS1="\d \t \u@\h:\w$"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
# if [ -x /usr/bin/dircolors ]; then
# test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
#     alias ls='ls --color=auto'
#     #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

#    alias grep='grep --color=auto'
 #   alias fgrep='fgrep --color=auto'
#    alias egrep='egrep --color=auto'
# fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
# alias ll='ls -alF'
# alias la='ls -A'
# alias l='ls -CF'
"

--
Bret Busby
Armadale
West Australia
(UTC+0800)
..............


Reply to: