Re: PS1 multiline with colors

2013-07-09 Thread Geir Hauge
2013/7/9 Dan Douglas > Can also give all the debug output %q formatting. > > exec {BASH_XTRACEFD}> >(set +x; while IFS= read -r x; do printf %q\\n > "$x"; done) Note that {BASH_XTRACEFD}>... won't work in bash 4.2 (or older). It's fixed for the next release though. http://lists.gnu.org/archive

Re: PS1 multiline with colors

2013-07-09 Thread Dan Douglas
On Monday, July 08, 2013 02:39:52 PM Linda Walsh wrote: > > Greg Wooledge wrote: > > > normal=$(tput sgr0) red=$(tput setaf 1) green=$(tput setaf 2) ... > --- > > BTW If you ever trace your code with "-x", tracing through > the above will change your terminal text color. > > You can get around

Re: PS1 multiline with colors

2013-07-08 Thread Linda Walsh
Greg Wooledge wrote: normal=$(tput sgr0) red=$(tput setaf 1) green=$(tput setaf 2) ... --- BTW If you ever trace your code with "-x", tracing through the above will change your terminal text color. You can get around that by using read: read _CRST < <(tput sgr0) #Reset read _CRed < <(

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ép

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 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 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-04 Thread Chris Down
> Repeat-By: > With mintty terminal: > PS1='\h Hello everybody\n\e[1;35m\]Hi\e[0m\]>' > << cursor up >> > << cursor down >> > the line look like: > Hi>PS1='\h Hello > > With putty terminal (with default configuration): > with the same

PS1 multiline with colors

2013-07-04 Thread BASTIDON , Stéphane
Configuration Information [Automatically generated, do not change]: Machine: i686 OS: cygwin Compiler: gcc-4 Compilation CFLAGS: -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'