Re: [Help-bash] read -ep and ANSI colour sequences
From:
Chris Down
Subject:
Re: [Help-bash] read -ep and ANSI colour sequences
Date:
Wed, 20 Feb 2013 19:39:03 +0800
User-agent:
Mutt/1.5.21 (2010-09-15)
On 2013-02-20 13:33, Pierre Gaston wrote:
> On Wed, Feb 20, 2013 at 1:30 PM, Chris Down <address@hidden> wrote:
> > On 2013-02-20 06:18, Chris F.A. Johnson wrote:
> >> read -ep $'\e[41;37;1m >> \e[0m '
> >
> > Whilst this is valid from bash2 onwards and should work fine, you should be
> > aware that if you require POSIX compatibility down the line, this will
> > break.
> >
> > ( Yes, I am aware this is `help-bash', not `help-posix' ;-) )
> >
> > Chris
> >
> For some value of fine, afaik in both case readline will not wrap
> correctly and I think there is no way to escape the terminal code like
> in PS1
\e[0m is the escape, unless you mean something else. It works for me:
$ read -ep $'\e[41;37;1m >> \e[0m ' ; echo "$REPLY"
>> foo
foo
Not sure what you mean about readline not wrapping correctly.
Chris