[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] color in bash read builtin prompt
From: |
Clark Wang |
Subject: |
Re: [Help-bash] color in bash read builtin prompt |
Date: |
Fri, 17 Oct 2014 20:37:30 +0800 |
On Fri, Oct 17, 2014 at 6:20 PM, Patrick Byrne <address@hidden> wrote:
> Hi,
>
> I am finding that color codes are not recognised in a 'read' prompt:
> read -e -p "\x1b[31mtarget_dir:${rst} " -i "${default_target_dir}"
> target_dir
>
> output:
> ^[[0;31;40mtarget_dir:\x1b[0m /home/digital/python_1411
>
> Is there a way around this please?
>
Try like this:
read -p $'\033[1;31mRED:\033[0m ' var
>
>
> --
> Patrick Byrne
>