You are not logged in.
Hello everyone!
I was messing around a bit in the Wiki and a read about this great way to color the terminal's output.
I was following this one https://wiki.archlinux.org/index.php/Co … er_prompts
The problem is the root output. It remains the same as the user text (white bold). If I press
# source ~/.bashrc
i get what i want but when i exit adn re-enter it's still white bold text.
There is anyway to make it permanent? I guess it should be permanent right?
Thanks for reading!
Last edited by Issam2204 (2013-02-22 16:02:44)
Offline
Works for me - assuming you're talking about using su?
Can you post your root's .bashrc?
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
alias ls='ls --color=auto'
#PS1='[\u@\h \W]\$ '
PS1='\[\e[0;31m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[0;31m\]\$ \[\e[m\]\[\e[0;32m\]'
This is strange: when i type "su" it works. But generally i type "su -" and with that it doesn't work.
Thanks for the correct assumption. Any idea how to make it work with "su -"?
Offline
su -
is a synonym for
su --login
Which starts a login session. In Bash (at least) a login session calls .bash_profile, not .bashrc. So you have three options -
1) Put the prompt also in your .bash_profile for root (you'll need to create one, and may want to look at the system default ones to make sure you don't remove any settings)
2) Create .bash_profile and source .bashrc from it. That way you only have to edit the prompt line in one place. It's what many (maybe even Arch by default, I forget) do in their user settings.
3) Some other that I haven't thought of.
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
3) some other option... create a color configuration file and source it at a global level... though this might not be entirely advisable. I guess you could create that color profile and just source it from every possible .bash*
Offline
I tried the second one and it did the trick!
Thank you very much skanky for your time and help!
Thank you WonderWoofy for your time as well!
Last edited by Issam2204 (2013-02-22 16:02:19)
Offline