[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug on bash shell - $PWD (and consequentely prompt) not updated whil
Re: Bug on bash shell - $PWD (and consequentely prompt) not updated while renaming current folder.
Fri, 19 Jun 2020 22:15:42 -0400
> On Jun 19, 2020, at 8:51 PM, email@example.com wrote:
> Bash Version: 5.0
> Patch Level: 11
> Release Status: release
> When we rename the current working directory, $PWD doesn't get updated
> as it would as it would if we just did a simple "cd directory". Because
> of that, the prompt will continue also to show the old current
> directory's name, and not the new name the folder has. But the problem
> comes from the current working directory's variable itself (proven by
> "echo $PWD") and not by the prompt itself. So it's a lot worse than a
> simple prompt update but, it has to do with with environment variables
> themselves. As environment variables are session-specific, I submitted
> this to you and not to the kernel bug tracking. Please tell me if I
> should inform other bug tracking also. Thanks.
I'd be hard-pressed to call this a bug, considering that bash is hardly the
only shell that behaves this way.
% cat /tmp/test
rm -fR /tmp/old /tmp/new
printf 'pre-mv: %s\n' "$PWD"
mv /tmp/old /tmp/new
printf 'post-mv: %s\n' "$PWD"
% bash --version | head -n 1
GNU bash, version 5.0.17(1)-release (x86_64-apple-darwin18.7.0)
% bash /tmp/test
% zsh --version
zsh 5.8 (x86_64-apple-darwin18.7.0)
% zsh /tmp/test
% ksh --version
version sh (AT&T Research) 93u+ 2012-08-01
% ksh /tmp/test
% port -q installed dash
dash @0.5.10.2_0 (active)
% dash /tmp/test
% yash --version | head -n 1
Yet another shell, version 2.48
% yash /tmp/test
Re: Bug on bash shell - $PWD (and consequentely prompt) not updated while renaming current folder., Chet Ramey, 2020/06/20