LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about Terminator configuration. (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-terminator-configuration-4175549470/)

robgeek 07-31-2015 11:01 AM

Question about Terminator configuration.
 
Hello!

I'm using Terminator and Arch Linux and i would like to hide my username and local folder when i'm a user and superuser. I know how to do that when i'm a user. I put "export PS1="> "" in "~/.bashrc" and it works fine, but i would like to set another color for "> " when i change to superuser and i don't know how to do that.

How can a do that?

Thanks!

michaelk 07-31-2015 03:10 PM

You can find many guides on how to customize the prompt.

There are actually 4 different prompts i.e PS1-PS4. PS2 is the secondary prompt which already uses ">" as default. If not changed will be white so technically you could tell the difference but if not paying attention you could easily get confused.

https://wiki.archlinux.org/index.php/Color_Bash_Prompt

robgeek 07-31-2015 03:28 PM

Quote:

Originally Posted by michaelk (Post 5399057)
You can find many guides on how to customize the prompt.

There are actually 4 different prompts i.e PS1-PS4. PS2 is the secondary prompt which already uses ">" as default. If not changed will be white so technically you could tell the difference but if not paying attention you could easily get confused.

https://wiki.archlinux.org/index.php/Color_Bash_Prompt

Thank you very much!
What i did was create a "/root/.bashrc" with the following content:
Code:

PS1="\[$(tput setaf 4)\]> \[$(tput sgr0)\]"
And in "~/.bashrc" i changed the content to this:
Code:

#PS1='[\u@\h \W]\$ '
PS1="> "

Now, is working fine!


All times are GMT -5. The time now is 03:21 AM.