Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= Newsgroups: gnu.bash.bug Subject: Re: Bug on bash shell - $PWD (and consequentely prompt) not updated while renaming current folder. Date: Fri, 19 Jun 2020 22:15:42 -0400 Lines: 63 Approved: bug-bash@gnu.org Message-ID: References: <051e2fbabf3a9912e5d4248efba0f02b@goncalo.pt> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.14\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1592619356 26886 209.51.188.17 (20 Jun 2020 02:15:56 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org, goncalo_nuno@sapo.pt To: correio@goncalo.pt Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=larryv.me; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=t j6FPro53MvtDUuT0NNQA8vDLo/LbL9WEnwKGn/eq00=; b=JhWUDwcdDGDwpLaeA gMb6+EorzNynql0WO0nD9jpHkowWFaw5+GANCsMlnDLw0cH5zykaib76DuoElw4J FLnMSL/aIMrwHbpUTe+mXMDeGTE6IHTEph/9GwXetjef/ks/yl/iEEXLyT1CszKZ 0/kssPyo4NevYy8VcHAHxCMJ4afj6Z9VmaZKaBVsFSPty/QQpYf9ekQnzXcqPkOr mMoLmlM52b3Z7+2N+gR5sizyEuoYk+tsQPh9ZkIvFJAEbdzHmi8R1l8pij/x5vg0 OASEZO1xd97wjRtPQLMGJrsfQugxuchzMFN/KG1oidu4goPJ3/P4mGHppSBR0qTp FndWw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=tj6FPro53MvtDUuT0NNQA8vDLo/LbL9WEnwKGn/eq 00=; b=NB/JcUbvkwYynZrEgRysbZ3VIzTLGkqhp2jBsNmUBTbXYGlaQcCnCRNVy Wofgucl8PLUa/J2M2pQKV5zLZgUG3RDCdv7IFXeMHh7iLCNXh+DObZLT2fwXsL4c bHNc9Bw+dNhSqc/CLsFJWvN6RxrwR+um8avbQtK/j9pYKqMCGaDsL4opxtsl7Lii idiesiWNMSaFxggptO4y7/iRBeR34GSnkZWzKp4CaHKxcEHoKYZWBMZYaIWDElR3 C5bcUGlVybY4y6HIC9dZFQ5CRuO20QlROWkqdRJv60o9jx1FHd8AuLevISMTx/FD zLpGza+Qd6fznHComJfz7Cajszk7g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudejjedgheeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtggfuhfgjfffgkfhfvffosehtje hmtdhhtddvnecuhfhrohhmpefnrgifrhgvnhgtvggpgggvlhojiihquhgviicuoehvqhes lhgrrhhrhihvrdhmvgeqnecuggftrfgrthhtvghrnhepjeeihfeiheehgfdvudfhteefje fhkeduffefhfeutedtkeetfeeugfeugfetjedunecuffhomhgrihhnpeifrgihrdgtrght necukfhppedutddtrdduvddrudekgedrvdegieenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehvqheslhgrrhhrhihvrdhmvg X-ME-Proxy: In-Reply-To: <051e2fbabf3a9912e5d4248efba0f02b@goncalo.pt> X-Mailer: Apple Mail (2.3445.104.14) Received-SPF: pass client-ip=64.147.123.25; envelope-from=vq@larryv.me; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/19 22:15:45 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <051e2fbabf3a9912e5d4248efba0f02b@goncalo.pt> Xref: csiph.com gnu.bash.bug:16415 Hi, > On Jun 19, 2020, at 8:51 PM, correio@goncalo.pt wrote: > > Bash Version: 5.0 > Patch Level: 11 > Release Status: release > Description: > 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 mkdir /tmp/old cd /tmp/old 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 pre-mv: /tmp/old post-mv: /tmp/old % zsh --version zsh 5.8 (x86_64-apple-darwin18.7.0) % zsh /tmp/test pre-mv: /tmp/old post-mv: /tmp/old % ksh --version version sh (AT&T Research) 93u+ 2012-08-01 % ksh /tmp/test pre-mv: /tmp/old post-mv: /tmp/old % port -q installed dash dash @0.5.10.2_0 (active) % dash /tmp/test pre-mv: /tmp/old post-mv: /tmp/old % yash --version | head -n 1 Yet another shell, version 2.48 % yash /tmp/test pre-mv: /tmp/old post-mv: /tmp/old -- vq