[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Offset error (when using PS1 with colors and newline)
From: |
dAniel hAhler |
Subject: |
Re: Offset error (when using PS1 with colors and newline) |
Date: |
Wed, 03 Oct 2007 03:16:58 +0200 |
User-agent: |
Thunderbird 2.0.0.6 (X11/20070924) |
Matthew Woehlke wrote:
>>>> 1. Set PS1="\033[01;37m[ \[\033[01;34m\]\w\[\033[00m\]
>>>> \033[01;37m]\n\$\033[00m "
>>> You need to bracket _every_ nonprinting sequence of characters with
>>> \[\].
>>
>> I've asked you before, but you've not answered, or it got lost.
>>
>> What nonprinting sequence is not escaped above?
>
> Two occurrences of "\033[01;37m]".
I see now. Thanks for pointing at it.
Fixing the PS1 above still triggers the bug, if you use "ls ./_ /fooooo"
though.
Please note that the PS1 above does not come from me, but from a bug
comment. There seems to be an issue
Can you reproduce the bug with PS1="\n\[\033[0m\]" (which seems to be
valid as far as I can see)?
I can trigger the misplacement of the cursor there with just "ls ./",
followed by tab-tab, while PS1="\[\033[0m\]\n" works.
It seems to get triggered by a newline and following non-printable
characters.