Re: [Help-bash] Expand a prompt string to calculate its length?
From:
Jesse Hathaway
Subject:
Re: [Help-bash] Expand a prompt string to calculate its length?
Date:
Wed, 19 Jun 2019 13:35:16 -0500
On Wed, Jun 19, 2019 at 1:33 PM Greg Wooledge <address@hidden> wrote:
>
> On Wed, Jun 19, 2019 at 11:18:29AM -0700, Andy Chu wrote:
> > The @P techniques works if you don't have color in your prompt. If you
> > have colors I'm not sure there's a way to do it in general.
>
> If the prompt has colors or other terminal escape sequences, then the
> question "calculate its length" is ambiguous at best. Does the OP want
> the byte length for storage, or the visible character length for
> display width?
I was hoping for the visible character length.