From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Allen Li Newsgroups: gmane.emacs.bugs Subject: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes Date: Thu, 2 Nov 2023 17:14:36 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006316e20609346426" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30098"; mail-complaints-to="usenet@ciao.gmane.io" To: 66903@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 03 01:15:52 2023 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 1qyhqp-0007fO-PV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Nov 2023 01:15:51 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyhqV-0007rA-3Z; Thu, 02 Nov 2023 20:15:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyhqR-0007qm-US for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 20:15:28 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyhqQ-0008Mn-Qp for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 20:15:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyhqz-000758-Nx for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 20:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Allen Li Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 03 Nov 2023 00:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 66903 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169897054327195 (code B ref -1); Fri, 03 Nov 2023 00:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 Nov 2023 00:15:43 +0000 Original-Received: from localhost ([127.0.0.1]:56420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyhqd-00074U-Tj for submit@debbugs.gnu.org; Thu, 02 Nov 2023 20:15:43 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:54556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyhqY-000748-Eo for submit@debbugs.gnu.org; Thu, 02 Nov 2023 20:15:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyhpt-0007lo-Fu for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 20:14:53 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyhpr-0007wl-6U for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 20:14:53 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2c508e76eb4so3801991fa.0 for ; Thu, 02 Nov 2023 17:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20230601.gappssmtp.com; s=20230601; t=1698970488; x=1699575288; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=cX8IA63u3bBeOm9jQsfh8gj47wVuE2ydweAefcykH9s=; b=py+h14dLOOE7Fw4dcOZ8UepezVtuq3yszW3JEZvi6SZ8+aHmbjTGt2nabH/skasnr5 ypFaqkhMdPDVzR4ox8utUq2Bkq0K7sniqXTUkWp1mz1PZM5HHcZV8dcpXCl4s1hUy6h+ wp183yNyYFKbU0F31M/7h/dfoDJER1HTQ/xlZ5pxd2WtYwbOBDKu9LR6si5LNyjZNmze S3wWxukIG1jfn1cuP4sHe0X6BxsnSez1IBXK5sSSIeSNvTqMKYl+6bXM8DhTfV5D8crp qy2qIpL9HZNBoNQouJV7OwXPWjTKWer4sHw80To/+q1fMXIkhurHydBOpZVx4GdhoUpe Fzew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698970488; x=1699575288; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cX8IA63u3bBeOm9jQsfh8gj47wVuE2ydweAefcykH9s=; b=rjqTIg+DtEFFzOjRtpDejoskdg3WZ0j9nJsG4Kn8nz/XlHwEp0y34mjvtJJ4IqwZy1 E7kAdo0bRTmI2NibGWlLuVrhicG0zxu5a43xQjsqKC2aDI9GFBx9IT/SyhPA2hHbcOhi eDKmpmT3x8Uv7wZudYg4oRrjhWVoyW0zbP9hm+ceslX+LfZcAVIBb5KgquJhkkfpnGD3 6JeObnW/8jrIJKLKg+XCCmiZdIXksSgPkWl1klTQrDTc7srkEFW1qcJRDKV91GkQ9OQM RySlFjd/bUoUK7yUHhhX2hA98O0jJJJaEN0kBREhOM44mBl24NHQk64OywZyDrfAGpFj UnXQ== X-Gm-Message-State: AOJu0YzTC+TPdRLmFS2maFzPUNjtJ5DUwXFaGpTUJZk+vo+EIuXxF2FK /jBXhiwGq7KKIx4GrnNYZWh4CRizLZ1pdA+6zUKXKZKuWffsDruviiA= X-Google-Smtp-Source: AGHT+IFJ58WoPjao7J9iVIQUNP/UbY4GPR9aEGhSeAE9tSUrrwdey0TpHER/EtyO0yw/69dVzhvskdMzPwHTcT4n6oU= X-Received: by 2002:a2e:7a19:0:b0:2c0:196c:e38f with SMTP id v25-20020a2e7a19000000b002c0196ce38fmr14761658ljc.1.1698970487423; Thu, 02 Nov 2023 17:14:47 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=darkfeline@felesatra.moe; helo=mail-lj1-x22a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273686 Archived-At: --0000000000006316e20609346426 Content-Type: text/plain; charset="UTF-8" Reproduce: (assume ~/bin exists) 1. M-x shell RET 2. cd ~//bin RET 3. M-: default-directory RET Expected: default-directory is ~/bin Actual: default-directory is /bin It seems like the directory tracker uses Emacs's convention for double slashes "resetting" a path to root, but most shells treat double slashes the same as single slashes. It looks like this should be fixed in `shell-cd` (which should also fix `shell-process-pushd`) by implementing "custom" path handling (compared to Emacs default path handling behavior). In GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0) of 2023-09-03, modified by Debian built on kokoro-ubuntu Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Debian GNU/Linux rodete --0000000000006316e20609346426 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Reproduce:

(assume ~/bin exists)

1. M-x shel= l RET
2. cd ~//bin RET
3. M-: default-directory RET

Expected:<= br>
default-directory is ~/bin

Actual:

default-directory i= s /bin

It seems like the directory tracker uses Emacs's conventi= on for double
slashes "resetting" a path to root, but most she= lls treat double slashes
the same as single slashes.

It looks lik= e this should be fixed in `shell-cd` (which should also fix
`shell-proce= ss-pushd`) by implementing "custom" path handling (compared
to= Emacs default path handling behavior).

In GNU Emacs 29.1 (build 1, = x86_64-pc-linux-gnu, GTK+ Version 3.24.37,
=C2=A0cairo version 1.16.0) o= f 2023-09-03, modified by Debian built on
=C2=A0kokoro-ubuntu
Windowi= ng system distributor 'The X.Org Foundation', version 11.0.12101007=
System Description: Debian GNU/Linux rodete
--0000000000006316e20609346426--