[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bash-bug
Subject:    Re: Prompt messed up if PS1 contains ANSI escape sequences
From:       alex xmb ratchev <fxmbsw7 () gmail ! com>
Date:       2023-09-07 15:56:07
Message-ID: CAALKErEgBTi4DO9p0aPq=jjCCAwPLACBVwjPZM57D5wtv+miXA () mail ! gmail ! com
[Download RAW message or body]

On Thu, Sep 7, 2023, 17:41 Kerin Millar <kfm@plushkava.net> wrote:

> On Thu, 7 Sep 2023 17:33:45 +0200
> alex xmb ratchev <fxmbsw7@gmail.com> wrote:
>
> > On Thu, Sep 7, 2023, 16:51 Kerin Millar <kfm@plushkava.net> wrote:
> >
> > > On Thu, 7 Sep 2023 15:53:03 +0200
> > > alex xmb ratchev <fxmbsw7@gmail.com> wrote:
> > >
> > > > On Thu, Sep 7, 2023, 15:46 Gioele Barabucci <gioele@svario.it>
> wrote:
> > > >
> > > > > On 07/09/23 15:00, alex xmb ratchev wrote:
> > > > > > u have to \[ esc-seq \]
> > > > > > eg inside \[ and \]
> > > > > >
> > > > > > PS1=$'\u\[\e[1m\]\h\[\e[0m- '
> > > > > >
> > > > > > should display hostname bold
> > > > >
> > > > > Thanks for the suggestion, but adding \] does not really fix the
> > > > > problem, it just masks it in many cases (better than nothing).
> > > > >
> > > > > Try:
> > > > >
> > > > > $ long_name="$(printf 'abcdef0123456789/%.0s' {0..20})"
> > > > > $ mkdir -p /tmp/$long_name
> > > > > $ cd /tmp/$long_name
> > > > > $ PS1='\n\[\e[1m\]\w\[\e[m\] \$ '
> > > > >
> > > >
> > > > foo=$' .. '
> > > > not
> > > > foo=' .. '
> > >
> > > $'' quoting is not required for that particular definition of PS1.
> > >
> >
> > o cause \e gets expanded .. ? didnt know ..
>
> Yes. \n also.
>

n was clear e was new
.. thxx .. greets ..

-- 
> Kerin Millar
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic