bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: colored bash prompts seem to confuse readline


From: Chet Ramey
Subject: Re: colored bash prompts seem to confuse readline
Date: Tue, 9 Feb 2010 14:27:34 -0500

> Well ok its not just a plain colored prompt, what I would like to use is
> this:
> 
>     txtred='\e[0;31m' # Red
>     bldgrn='\e[1;32m' # Green
>     txtrst='\e[0m'    # Text Reset
>     PROMPT_COMMAND=' \
>         if [ $? -eq 0 ]; then \
>             PROMPT_PREFIX="$txtred"; \
>         else \
>             PROMPT_PREFIX="$bldgrn$? "; \
>         fi '
> 
>     PS1='$(echo -ne "$PROMPT_PREFIX")'"\$\[$txtrst\] "

All non-printing character sequences must be enclosed in \[...\].

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]