Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

(none)

0 views
Skip to first unread message

News poster

unread,
Dec 29, 1993, 2:22:15 PM12/29/93
to
Newsgroups: gnu.bash.bug
Path: ca12.cad.ornl.gov!jxt
From: j...@ca12.cad.ornl.gov (Tolliver Johnny S)
Subject: bash prompt possible bug
Message-ID: <1993Dec29.1...@ornl.gov>
Lines: 38
Sender: use...@ornl.gov (News poster)
Reply-To: j...@ornl.gov
Organization: Oak Ridge National Laboratory
Date: Wed, 29 Dec 1993 18:34:52 GMT
Lines: 38


In my .bash_profile, I have
export PS1=^[[1m[`whoami`@`hostname`]'\w> ^[[0m'

The <escape>[1m turns on bold; <escape>[0m turns off bold, at least for
xterms. That makes my prompt look like this
[jxt@ca04]~>
when in $HOME. 'Course the bold doesn't make it through news. I use bold
because it makes it easy to see where a command started when scrolling back
through lots of output. Color would be even nicer, but xterm doesn't support
color escape sequences.

The problem with bash is when the prompt plus command is very long -- long
enough to wrap to the next line. Then pressing up-arrow (or C-p) followed by
C-a to get to the beginning of the previous command somehow gets confused
and off track, overwriting some of the command with [0m and generally looking
awful. This makes it really hard to edit within the line.

The problem obviously seems related to the fact that the prompt contains
characters that take up zero width. Somehow C-p C-a is unhappy about zero-width
characters in the prompt.

Note that C-p alone has no problem. It's C-a within the recalled line. I can
even use left arrow (or C-b) to march all the way to the beginning of the
command with no problem. Even C-b until the cursor is on the first line of
the multi-line (due to wrapping) command followed by C-a works fine. Of course
there is no problem using C-p C-a when the prompt plus command is only one
line long. Or for multiple lines when I get rid of the bold and unbold escape
sequences in the prompt.

Is there any way to fix this problem? I'm at 1.13.1-CWRU. Patch level 3 I
think. Perhaps it's fixed in patch level 4. Could anyone confirm?

Thanks,

Johnny Tolliver
Oak Ridge National Laboratory
(j...@ornl.gov)

0 new messages