[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash 4 cursor in my prompt
From: |
Special Sauce |
Subject: |
Re: Bash 4 cursor in my prompt |
Date: |
Wed, 8 Apr 2009 07:46:44 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Apr 8, 7:16 am, Greg Wooledge <wool...@eeg.ccf.org> wrote:
> On Tue, Apr 07, 2009 at 11:04:58PM -0700, Special Sauce wrote:
>
> > [anton@nobby-nobbs ~]$ echo $PS1
> > [\[\e[28;1m\]\u@\H\[ \e[0m\]\w]$
>
> ^^^
> The space after \[ is not correct. You're sending a space to the terminal
> (or possibly more than one space -- since you didn't quote "$PS1" when
> you expanded it, we can't tell), but you're telling bash that it isn't
> moving the cursor (because you have \[ before it).
>
> Whether that's causing your problems, I can't say, but it's definitely
> not right.
Didn't know that, but, like I said, works fine with bash 3.xx
Here is a minimalist start:
[anton@nobby-nobbs ~/bucket/bash-4.0]$ ./bash --version
GNU bash, version 4.0.17(1)-release (x86_64-unknown-linux-gnu)
...
[anton@nobby-nobbs ~/bucket/bash-4.0]$ ./bash -v
export PS1="[\[\e[28;1m\]\u@\H \[\e[0m\]\w]\$ "
[anton@nobby-nobbs ~/bucket/bash-4.0]$
Now the cursor is on top of the '/' between bash and bucket.
If I cd to my home directory and try to recreate the problem the
cursor is on top of the '-' in my hostname.
Maybe its always a fixed number of characters before the end of the
prompt... but why would that be happening?
- Re: Bash 4 cursor in my prompt, (continued)
- Message not available
- Re: Bash 4 cursor in my prompt,
Special Sauce <=
Re: Bash 4 cursor in my prompt, Ian Kelling, 2009/04/25