[opensuse] red prompt for root user
congratulations for this new feature in 10.3 ! I really like it ! 1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed... -- -Alexey Eremenko "Technologov" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Thursday 26 April 2007 11:15, Alexey Eremenko wrote:
congratulations for this new feature in 10.3 ! I really like it !
1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed...
You can define your $PS1 variable in root's .bashrc file like this: export PS1="\[\e[31;1m\]\u# \[\e[0m\]" This line surns your text red(\[\e[31;1m\]) prints the prompt (\u$ ) then turns the text coloring off (\[\e[0m\]) Other colors are likewise available using the following codes: RED "\e[0;31m]" YELLOW "\e[0;33m]" PURPLE "\e[0;35m]" WHITE "\e[0;37m]" BLUE "\e[0;34m]" BLACK "\e[0;30m]" CYAN "\e[0;36m]" BOLD "\e[1;1m]" BLINK "\e[5m]" INVERT "\e[7m]" UNDRLN "\e[4m]" OFF "\e[0;0m]" Almost certainly there are other ways to do this, but this is the one that I know. Perhaps others will share their methods. -- JAY VOLLMER JVOLLMER@VISI.COM TEXT REFS DOUBLEPLUSUNGOOD SELFTHINK VERGING CRIMETHINK - IGNORE FULLWISE -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 4/26/07, Jay C Vollmer <jvollmer@visi.com> wrote:
On Thursday 26 April 2007 11:15, Alexey Eremenko wrote:
congratulations for this new feature in 10.3 ! I really like it !
1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed...
You can define your $PS1 variable in root's .bashrc file like this:
export PS1="\[\e[31;1m\]\u# \[\e[0m\]"
This line surns your text red(\[\e[31;1m\]) prints the prompt (\u$ ) then turns the text coloring off (\[\e[0m\])
Other colors are likewise available using the following codes:
RED "\e[0;31m]" YELLOW "\e[0;33m]" PURPLE "\e[0;35m]" WHITE "\e[0;37m]" BLUE "\e[0;34m]" BLACK "\e[0;30m]" CYAN "\e[0;36m]" BOLD "\e[1;1m]" BLINK "\e[5m]" INVERT "\e[7m]" UNDRLN "\e[4m]" OFF "\e[0;0m]"
Almost certainly there are other ways to do this, but this is the one that I know. Perhaps others will share their methods.
Thanks a lot ! I'm considering adding this stuff to "Lessons for Lizards". Is there any extra info on that? Why two numbers for colors ? What do they mean ? What the "m" mean on the color table? -- -Alexey Eremenko "Technologov" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Alexey Eremenko wrote:
On 4/26/07, Jay C Vollmer <jvollmer@visi.com> wrote:
On Thursday 26 April 2007 11:15, Alexey Eremenko wrote:
congratulations for this new feature in 10.3 ! I really like it !
1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed...
You can define your $PS1 variable in root's .bashrc file like this:
export PS1="\[\e[31;1m\]\u# \[\e[0m\]"
This line surns your text red(\[\e[31;1m\]) prints the prompt (\u$ ) then turns the text coloring off (\[\e[0m\])
Other colors are likewise available using the following codes:
RED "\e[0;31m]" YELLOW "\e[0;33m]" PURPLE "\e[0;35m]" WHITE "\e[0;37m]" BLUE "\e[0;34m]" BLACK "\e[0;30m]" CYAN "\e[0;36m]" BOLD "\e[1;1m]" BLINK "\e[5m]" INVERT "\e[7m]" UNDRLN "\e[4m]" OFF "\e[0;0m]"
Almost certainly there are other ways to do this, but this is the one that I know. Perhaps others will share their methods.
Thanks a lot !
I'm considering adding this stuff to "Lessons for Lizards".
Is there any extra info on that? Why two numbers for colors ? What do they mean ? What the "m" mean on the color table?
The lines are ANSI escape sequences to get the colors. Here's a pretty good thorough explanation of what you can do in a prompt: http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html One thing to not forget is to make sure you surround all these with the special sequence saying to not count these characters as taking up room on the prompt line by using the special "\[" and "\]" sequences to begin and end each of them. Otherwise, bash gets confused and will wrap lines early. Note in the above link, how the colors are bracketed by these: local GRAY="\[\033[1;30m\]" local LIGHT_GRAY="\[\033[0;37m\]" local CYAN="\[\033[0;36m\]" local LIGHT_CYAN="\[\033[1;36m\]" local NO_COLOUR="\[\033[0m\]" (\033 and \e are equivalent). -- Jonathan Arnold (mailto:jdarnold@buddydog.org) Daemon Dancing in the Dark, an Open OS weblog: http://freebsd.amazingdev.com/blog/ UNIX is user-friendly. It's just a bit picky about who its friends are. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2007/04/26 13:05 (GMT-0500) Jay C Vollmer apparently typed:
On Thursday 26 April 2007 11:15, Alexey Eremenko wrote:
congratulations for this new feature in 10.3 ! I really like it !
1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed...
You can define your $PS1 variable in root's .bashrc file like this:
export PS1="\[\e[31;1m\]\u# \[\e[0m\]"
This line surns your text red(\[\e[31;1m\]) prints the prompt (\u$ ) then turns the text coloring off (\[\e[0m\])
That seems simple enough until you discover that you don't always have the same background color. So it needs the background color accounted for as well in order to guarantee adequate contrast. e.g., when on Konsole the background is white ("\[\e[30;47;1m\]\u# \[\e[0m\]"), but on tty[1-6] the background is black ("\[\e[37;40;1m\]\u# \[\e[0m\]"). How is that done?
Other colors are likewise available using the following codes:
RED "\e[0;31m]" YELLOW "\e[0;33m]" PURPLE "\e[0;35m]" WHITE "\e[0;37m]" BLUE "\e[0;34m]" BLACK "\e[0;30m]" CYAN "\e[0;36m]" BOLD "\e[1;1m]" BLINK "\e[5m]" INVERT "\e[7m]" UNDRLN "\e[4m]" OFF "\e[0;0m]" -- "Therefore, if anyone is in Christ, he is a new creation; the old has gone, the new has come!" 2 Corinthians 5:17 NIV
Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://mrmazda.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Felix Miata wrote:
On 2007/04/26 13:05 (GMT-0500) Jay C Vollmer apparently typed:
On Thursday 26 April 2007 11:15, Alexey Eremenko wrote:
congratulations for this new feature in 10.3 ! I really like it !
1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed...
You can define your $PS1 variable in root's .bashrc file like this:
export PS1="\[\e[31;1m\]\u# \[\e[0m\]"
This line surns your text red(\[\e[31;1m\]) prints the prompt (\u$ ) then turns the text coloring off (\[\e[0m\])
That seems simple enough until you discover that you don't always have the same background color. So it needs the background color accounted for as well in order to guarantee adequate contrast. e.g., when on Konsole the background is white ("\[\e[30;47;1m\]\u# \[\e[0m\]"), but on tty[1-6] the background is black ("\[\e[37;40;1m\]\u# \[\e[0m\]"). How is that done?
Change your default color schema for konsole (I prefer black background, green chars).
Other colors are likewise available using the following codes:
RED "\e[0;31m]" YELLOW "\e[0;33m]" PURPLE "\e[0;35m]" WHITE "\e[0;37m]" BLUE "\e[0;34m]" BLACK "\e[0;30m]" CYAN "\e[0;36m]" BOLD "\e[1;1m]" BLINK "\e[5m]" INVERT "\e[7m]" UNDRLN "\e[4m]" OFF "\e[0;0m]"
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 2007/04/30 18:10 (GMT+0400) Aaron Kulkis apparently typed:
Felix Miata wrote:
That seems simple enough until you discover that you don't always have the same background color. So it needs the background color accounted for as well in order to guarantee adequate contrast. e.g., when on Konsole the background is white ("\[\e[30;47;1m\]\u# \[\e[0m\]"), but on tty[1-6] the background is black ("\[\e[37;40;1m\]\u# \[\e[0m\]"). How is that done?
Change your default color schema for konsole (I prefer black background, green chars).
I don't like that choice at all. I like a white background in Konsole, and on the VTs my background color of choice is that used by mc, blue. What I'd like most is for 10.3's change to red to get reverted, because it was smart enough to be white on blue and black on white then. Red on white and red on blue are virtually invisible here. -- "Therefore, if anyone is in Christ, he is a new creation; the old has gone, the new has come!" 2 Corinthians 5:17 NIV Team OS/2 ** Reg. Linux User #211409 Felix Miata *** http://mrmazda.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I don't like that choice at all. I like a white background in Konsole, and on the VTs my background color of choice is that used by mc, blue. What I'd like most is for 10.3's change to red to get reverted, because it was smart enough to be white on blue and black on white then. Red on white and red on blue are virtually invisible here.
Open a usability bug ? -- -Alexey Eremenko "Technologov" -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Alexey Eremenko wrote:
congratulations for this new feature in 10.3 ! I really like it !
1. Who made it? 2. Where can I find documentation that allows me to change bash prompt? (colors, symbols, etc...) I know this is a bash-specific PS1/PS2 variables were changed...
if it's just a change of PS1 / PS2, then it should work in ksh, too, and with minor variation, csh / tcsh, in any virtual terminal which supports dircolors. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
I checked several of the links on: http://www.faqs.org/docs/Linux-HOWTO/Bash-Prompt-HOWTO.html many are down. export PS1="$PWD/\w\[\e[0;34m\]\u:)> \[\e[0m\]" /home/cwsiv/~/mp3/KennyG/GreatestHitscwsiv:)> As you can see it keeps up with the depth of the directory but there is an extra tilde and forward slash. Is this solvable in one line or do I need a multiple line function as given on the URL above. -- ___ _ _ _ ____ _ _ _ | | | | [__ | | | |___ |_|_| ___] | \/ | \ /|\ || |\ / |~~\ /~~\ /~~| //~~\ | \ / | \ || | X |__/| || |( `--. |__ | | \| \_/ / \ | \ \__/ \__| \\__/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (6)
-
Aaron Kulkis
-
Alexey Eremenko
-
Carl Spitzer
-
Felix Miata
-
Jay C Vollmer
-
Jonathan Arnold