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
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
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 < <(
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
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
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
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
> 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
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'