Re: Strange behavior with PS1 prompt



Donald Russell wrote:
On Sat, Oct 17, 2009 at 11:36, Petrus de Calguarium <kwhiskerz@xxxxxxxxx> wrote:
Donald Russell wrote:

Any ideas/suggestions?

None, except to report the bug.

I have noticed this problem on and off for years and it doesn't
have anything to do with the PS1 prompt. Try entering nothing on
the command line, then use the up and down arrows, and eventually
your prompt will pick up some stuff from a previous command,
although, if you press the backspace, you will see that the input
mark is as far left as it can go.

OK, thanks... I really only noticed this after putting newlines etc in
my PS1 prompt, or at least it got more bothersome then.

I'll file a bug against bash...

I don't think this is a bug. Rather, I think the problem is caused by
not escaping the color codes you have embedded in your prompt. Try
this instead:

export PS1="\n\[\033[0;35m\][\u@\h] ${PWD}\n$\[\033[0m\]"

The \[ and \] begin and end a series of non-printable characters.
This tells bash not to count those characters when determining the
length of the prompt. So the color escape sequences are wrapped in \[
and \].

--
Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Be wary of strong drink. It can make you shoot at tax collectors, and
miss.
-- Lazarus Long, "Time Enough for Love"

Attachment: pgpuSOLoux5tx.pgp
Description: PGP signature

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Relevant Pages

  • RE: Bug or Not? Cmd Prompt/Switching Issue
    ... Yes, if you can be more specific (which programs, examples, etc, what command ... When my PC is in a full screen program, I minimized it, which after i open ... prompt will open for a split second which minimizes the full screen program, ... A bug is a defect in the software code which doesn’t allow the software to ...
    (microsoft.public.windows.vista.general)
  • New Bug: Word 2007: Can result in deletion of template files
    ... We're calling it the "Double Save Prompt" bug. ... It destroys template documents in a non-retrievable fashion. ... I went through the document and applied the new quickstyle sheets to the ...
    (microsoft.public.word.application.errors)
  • Evolution 2.30.0.1 in F13: Message Reply + No Edit = No Discard Confirmation
    ... Either GPG/SMIME signing was automatically setting $is_edited=1, ... or it was simply defaulting to a prompt. ... thanks to the Redhat guys that fixed RH Bugzilla Bug 510249. ... $GPG_AGENT_INFO at F13 release time. ...
    (Fedora)
  • Re: Styles in Word 2007
    ... when you started Word using the /a switch and then selected the Prompt to ... Update Style option. ... and if it's enabled you'll encounter the bug. ... I usually keep Prompt to Update turned off. ...
    (microsoft.public.word.docmanagement)