Chet Ramey schrieb:
Bernd Eggink wrote:
I normally wrap the builtin cd into a function cd, which does some
additional things and then calls the builtin. Example:

   function cd
   {
    local list=$(echo *.bui)
    # ...
        builtin cd "$1"
   }

I have a PS1 like this:

   PS1="\\w \$ "

With bash 3, this worked well; cd-ing into a directory changed the
prompt immediately. With bash 4, however, the prompt keeps unchanged
after a call to cd and only gets adjusted after the _next_ command. I
noticed that this depends on a subshell being used in the function.
Without that, it behaves as before.

Is that a bug? I can get the intended behaviour by putting

   eval "PS1='$PS1'"

at the end of the function, but that's a rather ugly workaround.

Yep, it's a bug.  Try the attached patch; it works for me.

Works for me, too. Thanks!

Bernd

--
Bernd Eggink
http://sudrala.de



Reply via email to