You are not logged in.

#1 2011-08-26 09:15:17

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

[SOLVED] Bash prompt color do not change

Can't change my user bash prompt color, while root prompt does work correctly and changes colors whenever I edit /root/.bashrc
My root and user .bashrc are identical except for the colors:

# Check for an interactive session
[ -z "$PS1" ] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'

#setup XIM environment, needn't if use SCIM as gtk-immodules
export GTK_IM_MODULE=ibus
export QT_IM_MODULE=ibus
export XMODIFIERS="@im=ibus"

What overrides my user ~/.bashrc PS1 colors?

.Xdefaults

! Xft settings ---------------------------------------------------------------

Xft.dpi:        96
Xft.antialias:  true
Xft.rgba:       rgb
Xft.hinting:    true
Xft.hintstyle:  hintslight

! xterm ----------------------------------------------------------------------

xterm*geometry:           120x40
!XTerm*faceName:                         xft:Dejavu Sans Mono:pixelsize=14
xterm*font: -xos4-terminus-medium-*-*-*-14-*-*-*-*-*-koi8-u
xterm*dynamicColors:      true
xterm*utf8:               2
xterm*eightBitInput:      true
xterm*saveLines:          512
xterm*scrollTtyKeypress:  true
xterm*scrollTtyOutput:    false
xterm*scrollBar:          true
xterm*rightScrollBar:     false
xterm*loginShell:         true
xterm*jumpScroll:         true
xterm*multiScroll:        true
xterm*toolBar:            false
xterm*background: #242424
xterm*foreground: #43D15F

Last edited by tasty_minerals (2011-08-26 10:09:49)


lenovo thinkpad EDGE 13'

Offline

#2 2011-08-26 09:45:43

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Bash prompt color do not change

PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'

Produces yellow prompt and green input - is this what you wanted?

xterm*background: #242424
xterm*foreground: #43D15F

This determines xterm behavior wrt to font color.

Offline

#3 2011-08-26 09:47:19

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Bash prompt color do not change

karol wrote:
PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'

Produces yellow prompt and green input - is this what you wanted?

xterm*background: #242424
xterm*foreground: #43D15F

This determines xterm behavior wrt to font color.

ahh, yes, definitely, my bad.
thank you


lenovo thinkpad EDGE 13'

Offline

#4 2011-08-26 09:54:47

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Bash prompt color do not change

Actually that does work in any other terminal, except "xterm", xterm root coloring however works.
So, user bash prompt colors work in anything but "xterm".
Disabling background and foreground values in .Xdefaults do not help except for xterm turns b/w.
Xterm root coloring works right. Any ideas?

Last edited by tasty_minerals (2011-08-26 09:55:37)


lenovo thinkpad EDGE 13'

Offline

#5 2011-08-26 10:01:39

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Bash prompt color do not change

After disabling the xterm colors, have you sourced .Xdefaults again? Open a new xterm and try again. Disabling the colors fixes things here.

Offline

#6 2011-08-26 10:04:35

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Bash prompt color do not change

What do you mean "sourced"?
I did "xrdb -load .Xdefaults"
changed .bashrc values to PS1='\[\e[1;32m\][\u @ \@ \w]\$ \[\e[0;35m\]'
but xterm user colors font is black bg is white, while root colors correspond to PS1='\[\e[1;31m\][\u @ \@ \w]\$ \[\e[0;35m\]'
Other terminals work just fine, but I use xterm mostly. Hmmm

Last edited by tasty_minerals (2011-08-26 10:05:35)


lenovo thinkpad EDGE 13'

Offline

#7 2011-08-26 10:09:07

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Bash prompt color do not change

Sorry, I actually don't use .Xdefaults, I keep this stuff in .xinitrc.
You can create a file (I named it 'filename' here) with those pesky xterm colors and your PS1

[karol @ 12:06  ~]$ cat filename
xterm*background: #242424
xterm*foreground: #43D15F

PS1='\[\e[1;33m\][\u @ \@ \w]\$ \[\e[0;32m\]'

and run

. filename

Offline

#8 2011-08-26 10:09:07

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Bash prompt color do not change

well all works fine now, it seems like I somehow commented "!xterm*dynamicColors:      true"
thanks

Last edited by tasty_minerals (2011-08-26 10:09:30)


lenovo thinkpad EDGE 13'

Offline

#9 2011-08-26 10:10:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Bash prompt color do not change

tasty_minerals wrote:

well all works fine now, it seems like I somehow commented "!xterm*dynamicColors:      true"

I just wanted to ask you to comment it out, as I simply didn't know what it does ;P

Offline

#10 2011-08-26 10:11:45

tasty_minerals
Member
Registered: 2011-03-30
Posts: 191

Re: [SOLVED] Bash prompt color do not change

karol wrote:
tasty_minerals wrote:

well all works fine now, it seems like I somehow commented "!xterm*dynamicColors:      true"

I just wanted to ask you to comment it out, as I simply didn't know what it does ;P

I deleted .Xdefaults and recreated it with uncommented "xterm*dynamicColors:      true" and it seems to run well now.


lenovo thinkpad EDGE 13'

Offline

Board footer

Powered by FluxBB