From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#53927: 27.2; shell-mode dir tracking falls out of sync after popd in remote buffers Date: Tue, 15 Feb 2022 14:39:37 +0100 Message-ID: <87y22cw8o6.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6359"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 53927@debbugs.gnu.org To: Dan McCarthy Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 15 14:55:53 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nJyJ5-0001Ps-1u for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Feb 2022 14:55:51 +0100 Original-Received: from localhost ([::1]:60630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJyJ4-0007of-2V for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 15 Feb 2022 08:55:50 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:60556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJy3n-0004U6-0M for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 08:40:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJy3m-0007Pp-Lw for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 08:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJy3m-00042i-J2 for bug-gnu-emacs@gnu.org; Tue, 15 Feb 2022 08:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Feb 2022 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53927 X-GNU-PR-Package: emacs Original-Received: via spool by 53927-submit@debbugs.gnu.org id=B53927.164493238615509 (code B ref 53927); Tue, 15 Feb 2022 13:40:02 +0000 Original-Received: (at 53927) by debbugs.gnu.org; 15 Feb 2022 13:39:46 +0000 Original-Received: from localhost ([127.0.0.1]:43837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJy3W-000425-Fn for submit@debbugs.gnu.org; Tue, 15 Feb 2022 08:39:46 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:60855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJy3U-00041p-Vd for 53927@debbugs.gnu.org; Tue, 15 Feb 2022 08:39:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1644932378; bh=fls4l37U10EZ/Du0ZYkBmXG9dL12YYiUI1x7BI9rNvI=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ZaFuTQ+qg8Uplc2fn5dSwG28IhHjLoWa6hYPi15xDOkYF6tVWMN9LD+Fp3bS+dWop /xzNpOcXgK+KPscwE/eSr4mF4VATeNCx7kgMDs/DW9XoyOYZdpjH47Ak7ykHNHb/gn xuaL1YvAsxNEcR30FVg+gSJs537r5+2g+Uf88YlI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.158.128]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MtOKc-1o92Gq0Epy-00ush0; Tue, 15 Feb 2022 14:39:38 +0100 In-Reply-To: (Dan McCarthy's message of "Thu, 10 Feb 2022 15:18:46 -0500") X-Provags-ID: V03:K1:Nt7rOhjLERPB/bHaOEURa0zHSB9BYox0DCvdGVTsJ5xemJvoRB3 tVk6oLFHkGYdDPP8LYhvgVt4AH8J/YvflHo7L1Wp2IEdHXDcqFsabSCvpQmC7AgsfUDSztl aayM647KeIpuAUgUpePeqwu2AA3M2Py/X/zh48uSGDwxLOOydCXURYYFUV8wvkTUhuoKZgo o8/o9bNHlYQT3SG+SZcag== X-UI-Out-Filterresults: notjunk:1;V03:K0:bwTXMHWnKDg=:p3eS/onUZUy0QqPUrpnJfu bqiIr730hcXc0FhwfYxoKAatlydImJ2T2JxKqNv2h5/GrogyVdD3Sa3oaf53YsjAz0RJDxW5T Cb8LuunSYlsydtInwvgz6BM3/7IkXx/+cXxj5ytCjX9wfFRnTHm+Gsbn3D+IcAQrBFAd3iUnN Noh08tyO/yW4qvGvluC51B8jgxls55WEUsEhhChp9/fiUNTtbGFYCiSkuZNmbVmhC8svO3UHB oZGAwXIF0krIcyOg5n5xbGfLRpmHhYa7Kg0IZ6+jElHyKy98GoD4WrwiUwpbkDD5jumPUlPyI vRW0INNy+ka9k51YK0cBetfBTSM7d3+v5F/3ElD94+A+mplf6C8r4W55AjDB1BcEIv/SNJDWm qi7JbfcyKiz0nRydbcYqDvknpJqH+1TZ/i4HCAk6JB44Kz1Yx7mGIZdyB0wNCu0VmWob62foI t0IUTEZiJAYMEeuBxVRB7eEewvSUXtsGJDsaf5WeA2iScBrWnE2+rqJ1aVLl8EG7z6QnSbpSN r7fsBxr2loExiv+9hCsdCxVvFipXVFxEDmqr982zCIgfxf6gYWu3UF6z/34NLF8CoJBriOkWq bVs3asaSlzEM7lxA/dRAEgBh1k/g7n+BDGq29BtT8/RNL81IGeO/lkhnXjaSuQdNUW+Xv+e+7 kR1plTHI4j8SXJSb7Vteta9I91RXA35YMqJyvFm+m1u/1klAoq98HDY1i0vdHS0YrvPE/qY8y jtfWbYqZmYkUpniQb3/8iCIfMWTK+VfnjSJkNQu6f5s3ythvUIkSBpa4AsDG+Ihg/koXZDXf X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:226988 Archived-At: --=-=-= Content-Type: text/plain Dan McCarthy writes: Hi Dan, > Create a remote shell-mode buffer with C-u M-x shell, using bash as > the > remote shell. pushd into another directory, then popd > back. default-directory and shell-dirstack still have the other > directory even though the popd took effect in the remote process. > > The problem seems to be that shell-prefixed-directory-name returns a > string like > "/ssh:dan@solstice:/ssh:dan@solstice:/home/dan/Documents/", > doubling the remote prefix. > > Local shell-mode buffers do not have the problem. Thanks for the bug report, I could reproduce it locally. The appended patch fixes this for me, could you please check? Eli, it is a very simple patch. Any chance to commit it to the emacs-28 branch? Otherwise, I would commit it to master, but we need a marker to merge it back to the emacs-28 branch after the Emacs 28.1 release. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable diff --git a/lisp/shell.el b/lisp/shell.el index c0a82bca18..6198214abe 100644 =2D-- a/lisp/shell.el +++ b/lisp/shell.el @@ -942,7 +942,7 @@ shell-prefixed-directory-name dir (if (file-name-absolute-p dir) ;; The name is absolute, so prepend the prefix. - (concat comint-file-name-prefix dir) + (concat comint-file-name-prefix (file-local-name dir)) ;; For relative name we assume default-directory already has the pr= efix. (expand-file-name dir)))) --=-=-=--