You are not logged in.

#1 2012-07-06 07:48:10

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 686

[SOLVED]Bash prompt colors different in console as opposed in terminal

Hi

EDIT: I have solved the problem by copying /etc/skel/.bash_profile to my home directory.

Today i updated the system and the bash prompt is fine in my terminal (KDE Konsole or in Xterm) but not in consoles. For normal user (blue colors) i use this settings in the $HOME/.bashrc file:

PS1='[\e[0;36m\u\e[0m@\e[0;36m\h\e[0m]─[\e[0;33m\w\e[0m]\n└─\$ ' 

For root (red color) /root/.bashrc:

PS1='[\e[1;31m\u\e[0m@\e[1;31m\h\e[0m]─[\e[0;33m\w\e[0m]\n└─\$ '

Now, if i login in console as a normal user it doesn't display blue color but red as if i was root user. Like i said in xterm or KDE Konsole it looks just fine. The case is that consoles don't use my .bashrc file and use instead /etc/bash.bashrc file: Here is my /etc/bash.bashrc file:

#
# /etc/bash.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

#PS1='[\u@\h \W]\$ '
PS1='[\e[1;31m\u\e[0m@\e[1;31m\h\e[0m]─[\e[0;33m\w\e[0m]\n└─\$ '
PS2='> '
PS3='> '
PS4='+ '

case ${TERM} in
  xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

    ;;
  screen)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
    ;;
esac

[ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion


export EDITOR=/usr/bin/nano

Here is my today's update:

[2012-07-06 08:54] upgraded linux-api-headers (3.3.8-1 -> 3.4.4-1)
[2012-07-06 08:54] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
[2012-07-06 08:54] Generating locales...
[2012-07-06 08:54]   en_GB.UTF-8... done
[2012-07-06 08:54]   en_GB.ISO-8859-1... done
[2012-07-06 08:54] Generation complete.
[2012-07-06 08:54] upgraded glibc (2.15-12 -> 2.16.0-1)
[2012-07-06 08:54] upgraded binutils (2.22-7 -> 2.22-8)
[2012-07-06 08:54] upgraded dbus-core (1.6.0-5 -> 1.6.2-2)
[2012-07-06 08:54] upgraded dbus (1.6.0-1 -> 1.6.2-1)
[2012-07-06 08:54] upgraded device-mapper (2.02.96-2 -> 2.02.96-3)
[2012-07-06 08:54] upgraded gcc-libs (4.7.1-3 -> 4.7.1-4)
[2012-07-06 08:54] upgraded gcc (4.7.1-3 -> 4.7.1-4)
[2012-07-06 08:54] upgraded grep (2.12-1 -> 2.13-1)
[2012-07-06 08:54] upgraded initscripts (2012.06.3-1 -> 2012.06.3-2)
[2012-07-06 08:54] upgraded libpurple (2.10.4-2 -> 2.10.5-1)
[2012-07-06 08:54] upgraded libusb-compat (0.1.4-1 -> 0.1.4-2)
[2012-07-06 08:54] upgraded lvm2 (2.02.96-2 -> 2.02.96-3)
[2012-07-06 08:54] upgraded mpfr (3.1.0.p10-1 -> 3.1.1-1) 

Is it a problem in yesterday's pam upgrade? Yesterday i have moved /etc/pam.d/login.pacnew to /etc/pam.d/login. I didn't backup the old file. My bad. Weird thing is also this that today my KDE session crashed (for the first time) when i have used dd to burn image on my USB.

Last edited by Shark (2012-07-06 08:40:31)


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

Board footer

Powered by FluxBB