Bash prompt

Hi there !
I have a basic simple question I need an answer on.
I have a solaris 9 system where when you telnet as root, we get the "bash-2.05#" prompt.
I have found on my solaris 10 that I had to modify the /etc/passwd for root so that he can also have the bash shell when starting, but the prompt there is like "-bash-3.00#".
So my questions :
- why does it start with a "-" ?
- Wat do I need to do to have the pwd inserted before the "bash" ?
Many Thanks !

Hello,
Please change the shell variable PS1 to get things done.
ex:
-bash-3.00# echo $PS1
\s-\v\$
-bash-3.00#
Thanks,
Sal.

Similar Messages

  • [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)

    Procyon wrote:What you want is [ -n "$SSH_CONNECTION" ] (variable is set/nonzero length) or the opposite [ -z "$SSH_CONNECTION" ] (variable is not set/zero length)
    Thanks-- that got it.  I was missing the quotes, so it was expanding at the spaces rather than interpreting the entire thing as a string.

  • Tired of writing your own bash prompt?

    I realized a few days ago that I got tired of looking up arcane bash escape sequences just to customize my bash prompt. In the open source fashion, I wrote a gui in pyGTK that will automatically make one for you, if you just pick the things you want from a menu. It's not really done yet and there's still stuff that I need to add to it, but I thought i'd see if anyone around here had any comments, or would find it useful.
    Check it out: https://github.com/wisp558/promptool
    It's worth noting that I only implemented 3 of the most common bash variables, but I should fix that soon. (and the bold button is broken)
    Last edited by wisp558 (2011-08-19 09:31:46)

    Doomcide wrote:Nice! Good to see how this project develops . Another suggestion I have, is to add bright color (e.g.: \e[1;30m) support.
    Yeah, I plan to. Other things I'm looking at include a place to select the text color, (It'll use the last color in the prompt), background colors, underlined things and changing the whole textview background (I use a black urxvt, personally). I may even add a thing to save prompts or something. I might add an option to append the PS1 to one's ~/.bashrc, making the gui display the finished prompt rather than the terminal and more! I have plenty of ideas left!
    As a note, the escape you posted is just the bold option I already have. There is a high intensity option in bash, which I will look into, although it does nothing in my terminal. Those are things like '\e[0;90m' and its  friends.
    Thanks for your feedback, guys.

  • [solved]Gentoo Bash Prompt not working in X

    Hi
    I'm using this .bashrc from AUR:
    http://aur.archlinux.org/packages.php?ID=18418 
    it is said to be the standard bashrc from gentoo.
    It works with xterm, but I now installed urxvt (256 color) and it doesn't work any more, my prompt ist not colored any more.
    I'm not familiar with bash scripting, perhaps someone could have a look.
    The Problem ist not my .Xdefaults, I tried with an empty one. I also did "source .bashrc".
    Last edited by lustikus (2010-01-11 12:24:28)

    thanks for testing it.
    This is my .bashrc. I did not change anything:
    # /etc/bash/bashrc
    # This file is sourced by all *interactive* bash shells on startup,
    # including some apparently interactive shells such as scp and rcp
    # that can't tolerate any output. So make sure this doesn't display
    # anything or bad things will happen !
    # Test for an interactive shell. There is no need to set anything
    # past this point for scp and rcp, and it's important to refrain from
    # outputting anything in those cases.
    if [[ $- != *i* ]] ; then
    # Shell is non-interactive. Be done now!
    return
    fi
    # Bash won't get SIGWINCH if another process is in the foreground.
    # Enable checkwinsize so that bash will check the terminal size when
    # it regains control. #65623
    # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11)
    shopt -s checkwinsize
    # Enable history appending instead of overwriting. #139609
    shopt -s histappend
    # Change the window title of X terminals
    case ${TERM} in
    xterm*|rxvt*|Eterm|aterm|kterm|gnome*|interix)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
    screen)
    PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\033\\"'
    esac
    use_color=false
    # Set colorful PS1 only on colorful terminals.
    # dircolors --print-database uses its own built-in database
    # instead of using /etc/DIR_COLORS. Try to use the external file
    # first to take advantage of user additions. Use internal bash
    # globbing instead of external grep binary.
    safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
    match_lhs=""
    [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
    [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
    [[ -z ${match_lhs} ]] \
    && type -P dircolors >/dev/null \
    && match_lhs=$(dircolors --print-database)
    [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
    if ${use_color} ; then
    # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
    if type -P dircolors >/dev/null ; then
    if [[ -f ~/.dir_colors ]] ; then
    eval $(dircolors -b ~/.dir_colors)
    elif [[ -f /etc/DIR_COLORS ]] ; then
    eval $(dircolors -b /etc/DIR_COLORS)
    fi
    fi
    if [[ ${EUID} == 0 ]] ; then
    PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
    else
    PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
    fi
    alias ls='ls --color=auto'
    alias grep='grep --colour=auto'
    else
    if [[ ${EUID} == 0 ]] ; then
    # show root@ when we don't have colors
    PS1='\u@\h \W \$ '
    else
    PS1='\u@\h \w \$ '
    fi
    fi
    # Try to keep environment pollution down, EPA loves us.
    unset use_color safe_term match_lhs
    I also made a screenshot with xterm and urxvt in comparison:

  • Bash prompt changed from "macbook-pro" to "fdrs-ipad"

    Normally in bash my prompt began "macbook-pro" after trying to use AirDrop it is now "fdrs-ipad". This doesn't seem to have affected anything yet but I am unsure how this happened or what it may do eventually. I googled around to try to find solutions but I couldn't find anyone with a similar problem. Anyone have an idea what happened and how I can change this back?
    Thanks!

    sudo scutil --set HostName whatever-you-want
    If that doesn't work, the hostname is being set to the result of a reverse lookup of your IP address on a local DNS server, most likely your gateway.

  • How to change the bash prompt?

    When I open a shell, I get as prompt:
    user@myhost:~$
    Maybe it comes from my former Debian installation (I kept /home when installing Arch), because:
    $ echo $PS1
    ${debian_chroot:+($debian_chroot)}\u@\h:\w\$
    When I su to root, I get:
    bash-3.2#
    What do I have to do in order to get something like:
    root@myhost:/home/user#
    Browsing the Internet, I found that it has to do with /etc/profiles, but I did not manage to find out the specific steps.
    Thank you.

    Well, I renamed .bashrc (in order to keep it as a backup) in my home folder and then I got the bash-3.2$ prompt. For some reason, the PS1 in /etc/profile.bash is not taken.
    If I just su, I got bash-3.2#. If I "su -", I got [root@myhost ~]#. Hypothesis: /etc/profile.bash is only observed by the root environment. May this be right?
    So I edited the .bashrc that Debian had left, and I had to place it both as /home/user/.bashrc and /root/.bashrc. I copy it at the end. See that I made the prompt coloured when being root.
    Still, if I did "su -" or "su username -", or logged-in in text-mode as root, I got the profile that is on /etc/profile.bash So I renamed /etc/profile.bash and copied that same file /root/.bashrc as /etc/profile.bash. I hope not to have committed any insanity , otherwise please let me know.
    Thank you.
    # ~/.bashrc: executed by bash(1) for non-login shells.
    # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
    # for examples
    # If not running interactively, don't do anything
    [ -z "$PS1" ] && return
    # don't put duplicate lines in the history. See bash(1) for more options
    export HISTCONTROL=ignoredups
    # check the window size after each command and, if necessary,
    # update the values of LINES and COLUMNS.
    shopt -s checkwinsize
    # make less more friendly for non-text input files, see lesspipe(1)
    [ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
    ## set variable identifying the chroot you work in (used in the prompt below)
    #if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    # debian_chroot=$(cat /etc/debian_chroot)
    #fi
    # set a fancy prompt (non-color, unless we know we "want" color)
    #case "$TERM" in
    #xterm-color)
    # PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    # PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    #esac
    # Comment in the above and uncomment this below for a color prompt
    #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    ## If this is an xterm set the title to user@host:dir
    #case "$TERM" in
    #xterm*|rxvt*)
    # PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    #esac
    # Alias definitions.
    # You may want to put all your additions into a separate file like
    # ~/.bash_aliases, instead of adding them here directly.
    # See /usr/share/doc/bash-doc/examples in the bash-doc package.
    #if [ -f ~/.bash_aliases ]; then
    # . ~/.bash_aliases
    #fi
    # If id command returns zero, you've root access.
    if [ $(id -u) -eq 0 ];
    then # you are root, set colour prompt
    # see codes for colours on http://bash-hackers.org/wiki/doku.php/scripting/terminalcodes
    PS1="\\[$(tput setaf 5)\\][\\u@\\h:\\w]# \\[$(tput sgr0)\\]"
    else # normal
    PS1="[\\u@\\h:\\w]$ "
    fi
    # enable color support of ls and also add handy aliases
    if [ "$TERM" != "dumb" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
    #alias dir='ls --color=auto --format=vertical'
    #alias vdir='ls --color=auto --format=long'
    fi
    # some more ls aliases
    #alias ll='ls -l'
    #alias la='ls -A'
    #alias l='ls -CF'
    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
    # sources /etc/bash.bashrc).
    if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
    fi

  • [SOLVED]Color Bash Prompt help

    So I have been customizing my arch box and everything has been great except for one problem; the bash color prompt. I am kind of running a color screen where I am using the same shade of green, blues, grays, etc. I would like to continue that with my bash color prompt. However it seems to use some weird numbering system for its colors that I am not familiar with. I know that there is a way to use 256 colors, but I am not sure how.
    So for example I would like to have this shade of green from bash  0;32m' as this #87d75f  in html notation.
    Is there a way for this to be done? Thanks.
    Last edited by NoxSec (2011-07-15 20:52:08)

    The prompt inherits colours from those specified in .Xresources https://wiki.archlinux.org/index.php/Xresources

  • Bash prompt vs Zsh prompt problem [SOLVED]

    I have set up my .zshrc and it works perfectly
    function bat1()
    echo $(( $(awk ' /remaining/ {print $3} ' /proc/acpi/battery/BAT0/state) * 100 / 71590 ))
    # 71590 is the capacity of my #1 bat in mWh
    function bat2()
    echo $(( $(awk ' /remaining/ {print $3} ' /proc/acpi/battery/BAT1/state) * 100 / 46620 ))
    # 46620 is the capacity of my #2 bat in mWh
    #Right-side zsh promp :
    RPROMPT=' $PR_RED$(bat1)/$(bat2)$PR_NO_COLOR'
    Each time I get a new prompt(when a command finishes or I simply type <Return>) the battery info is updated.
    Now let's consider bash :
    Same functions, same way of working :
    PS1="$(bat1)/$(bat2) >"
    The problem is that bash does not automatically update the battery info. I need to source my .bashrc, which is, of course, a real pain.
    Can any bash guru help me to find a solution to make bash work like zsh ?

    Try
    PS1="$(bat1)/$(bat2) >"

  • Bash Prompt on Nexus 6001

    Anybody seen this or know how to get the switch to boot back into NX-OS?  We upgraded a pair of Nexus 6001s to 6.0(2)N2(1)... one came up fine, the other keeps coming up to a BASH-3.2# prompt and we appear to have full root access.
    I'm guessing this is not normal behavior but I'm trying to see if anybody has seen this while we get TAC on it.  I attached a screenshot for your viewing pleasure.
    Thanks.                  

    Hello,
    I am from TAC. you are hitting a bug. CSCuh28244
    Symptom:
    Nexus 6000 might experience unexpected reload when the switch is getting booted up after being upgraded using
    install all
    command. It will take a long time for the switch to boot up. Instead of  booting all the way, the console will boot in bash mode. Eventually the  switch would experience a crash.
    Conditions:
    Issue happens after upgrading switch from
    6.0(2)N1(2)
    to
    6.0(2)N2(1)
    and when using
    install all
    command to upgrade.
    Workaround:
    power cycle the switch to restore services.
    Thanks,
    Richard
    * Rate if this is useful

  • [Solved] Change bash prompt listing in terminal

    Hi,
    I've always used c-shell for ease in writing shell scripts. I'm interested in moving to bash and just using c-shell for scripting.
    In a .cshrc I can do something like this:
    if [ -o /bin/su ]; then
    set prompt="%{\e]2\;%t - %m:%/^g\e]1\;%m^g\r%}%B:%m%b# "
    else
    set prompt="%{\e]2\;%t - %m:%/^g\e]1\;%m^g\r%}%B:%m%b$ "
    fi
    I edited the if statement for what an if statement should look like in bash. This, however, doesn't work. I'm assuming the word "prompt" is wrong. How do I get this working in bash?
    EDIT: SEEMS LIKE THIS DID IT!
    PS1="\u@\h:\w#
    Last edited by playdafunkimuzic (2009-08-27 18:29:51)

    export PS1="whatever" is the way to set the prompt in bash.  not sure bout that -o are you checking for root? if so, [ $(id -u) -iq 0 ] returns true for root.

  • ::SOLVED:: change bash prompt while in ssh

    I'm learning how to use bash bit by bit, but came up with a question I'm not certain how to solve.  I learned some time ago about setting the PS1 variable to customize the shell prompt, and have a nice prompt I like using.  However, it would be nice to have the prompt be flagged if I'm logged in through ssh as opposed to directly on the computer itself.  How could I do this?
    One thought I had was to check to see if certain environment variables exist (eg. $SSH_CONNECTION).
    Doing if [ $SSH_CONNECTION ]; then ... fi gives an error about too many arguments.  None of the other SSH related variables seem to be just a number value.  Is there a way to test for the existence of a variable in bash?
    Last edited by beretta (2009-05-07 20:44:06)

    Procyon wrote:What you want is [ -n "$SSH_CONNECTION" ] (variable is set/nonzero length) or the opposite [ -z "$SSH_CONNECTION" ] (variable is not set/zero length)
    Thanks-- that got it.  I was missing the quotes, so it was expanding at the spaces rather than interpreting the entire thing as a string.

  • Color Bash prompt Wiki needs editing [SOLVED]

    Howdy archers
    I didn't know where else or who I should contact for this....
    but I found something that "may" need editing on this part of the wiki     http://wiki.archlinux.org/index.php/Color_Bash_Prompt
    the part where it says     * Edit root's Bash file; copy it from /etc/skel if the file is not present:
    # nano /root/.bash_profile
    I tried this over and over again with no luck... then I figured out that the info on the wiki was incorrect... you are not suppose
    copy ".bash_profile" to /root     you are suppose to copy    ".bashrc" over to /root and add what you want in it... otherwise
    no changes take effect
    cheers
    Last edited by kaddy (2010-05-26 09:24:36)

    oh yeah... I forgot anybody can edit the arch wiki... will do

  • Bash prompt delay

    Hi there.
    I'm having a problem with a delay right after logging into the virtual terminal. I type the username and password, see the 'last logged in at...' message...and then I get nothing for about 15 seconds. It only happens on the first login and only happens on my user account (the other being root). I've tried to duplicate the problem with bash -lv to no avail. htop doesn't give any above average CPU usage and I don't see any disk activity.
    Any ideas? Something else to try?
    Thanks.

    It took some trickery, but I found out a way to debug this. Create a file somewhere (eg /bash-verbose) and make it executable. Put the following contents in it:
    exec /bin/bash -v
    Now modify your /etc/passwd and change /bin/bash for your user and replace /bin/bash at the end of line, with the path to the script created above. This way you will get a verbose bash login shell which should tell you what your waiting for. Would you like even more info you could strace the bash process as well.
    Last edited by Spider.007 (2011-12-17 13:36:55)

  • [SOLVED] Color Bash Prompt - Arch Latest News w/o description

    Hi everybody, i'm trying to get the Arch Latest News in the bash profile when terminal starts. I followed the wiki https://wiki.archlinux.org/index.php/Co … s_at_logon and I can show the latest news without problems. What I want to do is to show only the titles and links, without description, that uses much space in the terminal. I tried to figure out what lines I should delete in the /etc/bash.bashrc file but.. you know the sintax is pretty obscure for the most of us (at least for me). I see that there is a description line.. but, really I can't manage this. How can I do this? Thanks in advance.
    Last edited by crixus-ita (2013-01-17 13:42:43)

    Here's one way of doing it:
    echo -e "$(echo $(curl --silent https://www.archlinux.org/feeds/news/ | sed -e '
    :a;N;$!ba;s/\n/ /g') | \
    sed -e 's/&amp;/\&/g
    s/&lt;\|&#60;/</g
    s/&gt;\|&#62;/>/g
    s/<\/a>/£/g
    s/href\=\"/§/g
    s/<title>/\\n\\n\\n :: \\e[01;31m/g; s/<\/title>/\\e[00m ::\\n/g
    s/<link>/ [ \\e[01;36m/g; s/<\/link>/\\e[00m ]/g
    s/<description>/\\n\\n\\e[00;37m/g; s/<\/description>/\\e[00m\\n\\n/g
    s/<p\( [^>]*\)\?>\|<br\s*\/\?>/\n/g
    s/<b\( [^>]*\)\?>\|<strong\( [^>]*\)\?>/\\e[01;30m/g; s/<\/b>\|<\/strong>/\\e[00;37m/g
    s/<i\( [^>]*\)\?>\|<em\( [^>]*\)\?>/\\e[41;37m/g; s/<\/i>\|<\/em>/\\e[00;37m/g
    s/<u\( [^>]*\)\?>/\\e[4;37m/g; s/<\/u>/\\e[00;37m/g
    s/<code\( [^>]*\)\?>/\\e[00m/g; s/<\/code>/\\e[00;37m/g
    s/<a[^§|t]*§\([^\"]*\)\"[^>]*>\([^£]*\)[^£]*£/\\e[01;31m\2\\e[00;37m \\e[01;34m[\\e[00;37m \\e[04m\1\\e[00;37m\\e[01;34m ]\\e[00;37m/g
    s/<li\( [^>]*\)\?>/\n \\e[01;34m*\\e[00;37m /g
    s/<!\[CDATA\[\|\]\]>//g
    s/\|>\s*<//g
    s/ *<[^>]\+> */ /g
    s/[<>£§]//g
    ')\n\n" | grep -E "^( :| \[)";
    The change is the addition of the grep command at the very end.

  • Magic Bash Prompt

    This magical prompt will cycle through the colors of the rainbow! It'll work properly if your terminal follows ANSI colors. (i.e. it works on the Linux console)
    UPDATE: Version 1.0.0 released! Includes new random_hue function for random colors!
    In your .bashrc file:
    # Magic Prompt 1.0.0
    function next_hue
    color=$((31 + (++color % 7))) # set 31 to 30 for dark on light
    PS1="\[\e[1;${color}m\]\\$ $reset" # set 1 to 0 for dark on light
    function random_hue
    color=$(($RANDOM % 7 + 31)) # set 31 to 30 for dark on light
    PS1="\[\e[1;${color}m\]\\$ $reset" # set 1 to 0 for dark on light
    PROMPT_COMMAND="random_hue"
    Try it out, and comment out your old PS1. It's cool if you hold down the return key.
    Last edited by Anikom15 (2010-11-30 03:53:44)

    Hillarious waste of the PROMPT_COMMAND, but still hillarious. @drcouzelis: no, sadly this isn't something you can really get around. ZSH offers the ability to specify multiple precmd hooks.
    I've condensed it into pure awesome:
    next_hue() {
    color=$(( 30 + (++color % 8) ))
    echo -ne "\e[1;${color}m" # change 1 to 0 for darker colors
    PROMPT_COMMAND=next_hue
    PS1="\$\[\e[0m\] "
    Last edited by falconindy (2010-11-29 04:30:14)

Maybe you are looking for