bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

2 regressions related to PROMPT_COMMAND


From: smallnow
Subject: 2 regressions related to PROMPT_COMMAND
Date: Sun, 01 Mar 2009 22:29:00 -0800
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-unknown-linux-gnu' -DCONF_VENDOR='unknown' -DLOCALEDIR='/a/local/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib -g -O2 uname output: Linux ul 2.6.27-12-generic #1 SMP Thu Feb 5 09:26:42 UTC 2009 x86_64 GNU/Linux
Machine Type: x86_64-unknown-linux-gnu

Bash Version: 4.0
Patch Level: 0
Release Status: release

Description:
Neither of these happen on the same system with 3.2.39(1)-release.

Bug #1:
do:
PROMPT_COMMAND='$(cd)'
Then do anything that would change your prompt, for example change directories when PS1 contains the current directory. You will see the prompt will never update when PROMPT_COMMAND contains any command substitution. It just remains whatever it was when this was set. I used $(cd) as a trivial command substitution, but any command substitution seems to have the same effect.

I actually had some useful code including parameter expansions going on in my PROMPT_COMMAND. This took quite a while to figure out.


Bug #2:
do:
PS1=
PROMPT_COMMAND='echo -ne $PWD'
press up, then down.
This brings up the last history and then goes to the new command again. The cursor goes goes to the beginning of the line screwing up text from PROMPT_COMMAND. This also happens with vi-mode commands. I put PS1= so that it doesn't confuse the issue, but that is not necessary.


Btw, thanks for bash 4. :)

- Ian Kelling




reply via email to

[Prev in Thread] Current Thread [Next in Thread]