text color use for normal user and root user
Bug #1516353 reported by
kay van der Zander
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Terminal |
Triaged
|
Medium
|
Unassigned |
Bug Description
from the question section: https:/
give the terminals which are logged on in root user change the text color (red is suggested by the question)
This can also be extended to when there is "sudo " present in the text to change it to a color.
The question also states that normal terminals text also should get a color (green is suggested by the question)
to have the good and bad difference visible.
To post a comment you must log in.
#The approach I use moves to .bashrc the following for normal terminals: prompt= yes
force_color_
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
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then "[\[\e[ 0;32m\] \d\[\e[ 0m\] - \[\e[3; 32m\]\A\ [\e[0m\ ]] \[\e[1; 32m\]\u\ [\e[0m\ ]@\[\e[ 1;33m\] \h\[\e[ 0m\]\[\ e[1;35m\ ]:\[\e[ 0m\]\[\ e[1;34m\ ]\w\[\e[ 0m\]\$ " debian_ chroot: +($debian_ chroot) }\[\033[ 01;32m\ ]\u@\h\ [\033[00m\ ]:\[\033[ 01;34m\ ]\w\[\033[ 00m\]\$ '
PS1=
# PS1='${
else '${debian_ chroot: +($debian_ chroot) }\u@\h: \w\$ '
PS1=
fi
unset color_prompt force_color_prompt