Re: PS1 multiline with colors

2013-07-05 Thread Greg Wooledge
On Fri, Jul 05, 2013 at 12:50:53AM +0800, Chris Down wrote: > > PS1='\h Hello everybody\n\e[1;35m\]Hi\e[0m\]>' > You need to properly indicate that the control codes are zero-width > (by using \[ and \]). Without them, this is expected behaviour. > > Better, don't hardcode the escape code

Re: PS1 multiline with colors

2013-07-05 Thread Greg Wooledge
On Fri, Jul 05, 2013 at 12:21:13PM +, BASTIDON, Stéphane wrote: > Now my case is a little more complex: > I want my prompt changes colors according to $PWD Then I write something like > that: This is the kind of thing where I suggest using PROMPT_COMMAND. normal=$(tput sgr0) red=$(tput setaf

Re: PS1 multiline with colors

2013-07-05 Thread Dan Douglas
This function (colorSet) takes one or more associative array names and can populate it with a few predefined color palates. Written for Bash/ksh93/zsh. http://wiki.bash-hackers.org/snipplets/add_color_to_your_scripts -- Dan Douglas

RE: PS1 multiline with colors

2013-07-05 Thread BASTIDON , Stéphane
I'll try that asap ... Thanks -Message d'origine- De : Greg Wooledge [mailto:wool...@eeg.ccf.org] Envoyé : vendredi 5 juillet 2013 14:31 À : BASTIDON, Stéphane Cc : bug-bash@gnu.org Objet : Re: PS1 multiline with colors On Fri, Jul 05, 2013 at 12:21:13PM +, BASTIDON, Stéphane wrote: