[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] read -ep and ANSI colour sequences
From: |
Chet Ramey |
Subject: |
Re: [Help-bash] read -ep and ANSI colour sequences |
Date: |
Wed, 20 Feb 2013 10:23:00 -0500 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 |
On 2/20/13 5:01 AM, muji wrote:
> Hi,
>
> I would like to use ANSI colour sequences when showing a prompt using
> read -ep but I can't figure out how to do this. Is this possible? Am I
> missing something? Using standard escape sequences does not appear to
> work, my current test code looks like:
>
> read -ep "\033[1mABC\033[0m" value;
>
> Using echo -e the output is bold as expected:
>
> echo -e "\033[1mABC\033[0m";
The basic problem is that read -p doesn't interpret octal sequences and
convert them to single characters, and echo -e does.
Chet
--
``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/
- Re: [Help-bash] read -ep and ANSI colour sequences, (continued)
- Re: [Help-bash] read -ep and ANSI colour sequences, muji, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Greg Wooledge, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, muji, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Chris F.A. Johnson, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, muji, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Matthew Cengia, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Chris F.A. Johnson, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Chet Ramey, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Chet Ramey, 2013/02/20
- Re: [Help-bash] read -ep and ANSI colour sequences, Pierre Gaston, 2013/02/20
Re: [Help-bash] read -ep and ANSI colour sequences,
Chet Ramey <=
Re: [Help-bash] read -ep and ANSI colour sequences, John Kearney, 2013/02/20