From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 02 20:15:43 2023 Received: (at submit) by debbugs.gnu.org; 3 Nov 2023 00:15:43 +0000 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 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 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 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 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) MIME-Version: 1.0 From: Allen Li Date: Thu, 2 Nov 2023 17:14:36 -0700 Message-ID: Subject: 29.1; shell-mode directory tracking incorrectly handles double slashes To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="0000000000006316e20609346426" 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --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-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 03:16:55 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 07:16:55 +0000 Received: from localhost ([127.0.0.1]:56658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyoQF-0001Ah-El for submit@debbugs.gnu.org; Fri, 03 Nov 2023 03:16:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52116) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyoQA-0001AO-3D; Fri, 03 Nov 2023 03:16:50 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoPV-0006k0-8K; Fri, 03 Nov 2023 03:16:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Qped4HY4qfJZr+OTcKkXBSMYi4D7X5xaHgM0Whteang=; b=mufoZTgZQ8Pa 4CrVXEV9WJdayG8fH2TfA+sM/g4qbGKwYnkJDkcqP1UwyU+t97tT4xesC3PkriYFhARyP0haBnIoH EyUWED+hgF2tPKooFdsfrRvi2SbYoPyqC0e7ZIMrkeFO99+tlRLavcooiCUKW5UZHzf7nBdOA2RNc yjfaQqgmok89E1mxVfcWGZTien37U7XO+8lqNFFXIi4h33mjjzkfp4tGZYsM6CcCA57L0UO4w2KjR vvM/RdZLDIP7DOa3d25zeNh1IA0Q1sqSJxMHdf1kzIBvU03fGw4ObFRTgXEOHJnYTPn5ZTMkNTQ9a XLAvuyxCuFTS3k9b9X23eA==; Date: Fri, 03 Nov 2023 09:15:59 +0200 Message-Id: <83pm0r71e8.fsf@gnu.org> From: Eli Zaretskii To: Allen Li In-Reply-To: (message from Allen Li on Thu, 2 Nov 2023 17:14:36 -0700) Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) severity 66903 wishlist thanks > From: Allen Li > Date: Thu, 2 Nov 2023 17:14:36 -0700 > > (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 This is the standard Emacs behavior: double slash makes everything before that ignored. > 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. "M-x shell" is not a shell, it is an Emacs interface to a shell. Thus, it should be free to implement behavior not present in the shell, if we consider it convenient for Emacs users. > 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). This is not a bug. I'm okay with adding a new optional feature that would disable the above behavior, but it must be off by default. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 03:23:22 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 07:23:22 +0000 Received: from localhost ([127.0.0.1]:56671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyoWX-0001Kq-U4 for submit@debbugs.gnu.org; Fri, 03 Nov 2023 03:23:22 -0400 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:39294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyoWV-0001Kb-HX for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 03:23:20 -0400 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2c519eab81fso3959981fa.1 for <66903@debbugs.gnu.org>; Fri, 03 Nov 2023 00:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20230601.gappssmtp.com; s=20230601; t=1698996158; x=1699600958; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5XOHnPQoIQMC6oLcMiFeyvAfDBHca+XO1DzGqZfIdNY=; b=Aer2/uvbtuk4qWsTdlFJBjitQfTyLa47gMHK2HJUGKM9kkIxqVl9Aq3cgbvaQPZwtv 4etBNXKuCgYullCbafqQQMSKGo6v+jpQ02VwTDLx79sElBHrlOETuSeIMoZ6fuVFCZ1S z/lL5cwY9dIruyefre+k4YeCV76xJ54fLuWAqjOptOXbLuESKUfDC+UaKuud2cuuMoXy 9m0LFWROP5Z9S6UpfonQay+jJ8GAkxXdAIU58gCAq4aOCzISNIeB2jLS0116woMZ3RQf XSC0dzGGCdVteG4EagGusUsnLRlXvDYt0kT3nyZADJJQ5okuhZQiagdBbSPNDGPgbrvd TFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698996158; x=1699600958; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5XOHnPQoIQMC6oLcMiFeyvAfDBHca+XO1DzGqZfIdNY=; b=MbWgEu/xxXP0xib28u48svRQ4sIWw/Am8bxc/6cdXXn8JJRwxOQs5jTBmk2G/4RBpD ck8F4kOFLelthVgIzP+lr6FY96ckF8tClSjoVToIoNke0/fbV8AlJbIx343iCzMbUUwG TFrNRN0e2w40LsqWq8Wyk85HJmFq/Swv0RmkvlnBLZp7oeCoikZQlLXXxwp7OyJM1PvA gYjQm+NJfvFMNv8LIypFZieuAKFwrFNg3SqlO0mURCS0pz9WsiFqo24Gmkl4FFq1QWrv 7GgIJEYf7r6Yg2EYMAqGSqgn2cqwF6LhxuTjbeHpQEScprN/hIw+9NM/zVcu9n6HED0k t5pQ== X-Gm-Message-State: AOJu0YwWLaN74qzE+W2W2QMK0kQihDnnWVH3OrdTzdEfNRfb6TR8P8JR /DhH32zPYoCgbc209dkpyg93UvEHCAjhufrmfg8aLb0zVmg9UpsJUBs= X-Google-Smtp-Source: AGHT+IGzP0Z+7PrWnal7lpPnyjq4a9n2r95MSB/ZNljRKcNuGD2vgR9DVutAOlKHzFesJeGB7uvBo9mFtHNFLiHdHBg= X-Received: by 2002:a2e:9a89:0:b0:2be:5485:4a99 with SMTP id p9-20020a2e9a89000000b002be54854a99mr14883885lji.4.1698996157980; Fri, 03 Nov 2023 00:22:37 -0700 (PDT) MIME-Version: 1.0 References: <83pm0r71e8.fsf@gnu.org> In-Reply-To: <83pm0r71e8.fsf@gnu.org> From: Allen Li Date: Fri, 3 Nov 2023 00:22:26 -0700 Message-ID: Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes To: Eli Zaretskii Content-Type: multipart/alternative; boundary="00000000000078b3ed06093a5ee3" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000078b3ed06093a5ee3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 3, 2023 at 12:16=E2=80=AFAM Eli Zaretskii wrote: > > "M-x shell" is not a shell, it is an Emacs interface to a shell. > Thus, it should be free to implement behavior not present in the > shell, if we consider it convenient for Emacs users. > The behavior it is supposed to implement is that it tracks the working directory of the shell. Currently, it fails to do so for most shells that a user would use. In fact, it fails to do so for the default value `/bin/bash`. > > 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). > > This is not a bug. I'm okay with adding a new optional feature that > would disable the above behavior, but it must be off by default. > This is absolutely a bug. The feature, where shell-mode attempts to track the working directory of its subshell, fails to work for most shells in existence (e.g., derivatives of POSIX sh, csh, zsh, etc.) and including the default shell. I agree it may be an option, but I disagree that it should be off by default, given that the default configured shell Bash requires it. --00000000000078b3ed06093a5ee3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Nov 3, 2023 at 12:16=E2=80=AFAM E= li Zaretskii <eliz@gnu.org> wrote= :

"M-x shell" is not a shell, it is an Emacs interface to a shell.<= br> Thus, it should be free to implement behavior not present in the
shell, if we consider it convenient for Emacs users.
<= br>
The behavior it is supposed to implement is that it tracks th= e working directory of the shell.
Currently, it fails to do so fo= r most shells that a user would use.
In fact, it fails to do so f= or the default value `/bin/bash`.
=C2=A0
> It looks like this should be fixed in `shell-cd` (which should also fi= x
> `shell-process-pushd`) by implementing "custom" path handlin= g (compared
> to Emacs default path handling behavior).

This is not a bug.=C2=A0 I'm okay with adding a new optional feature th= at
would disable the above behavior, but it must be off by default.

This is absolutely a bug.=C2=A0 The feature, wher= e shell-mode attempts to track the working=C2=A0
directory of its= subshell, fails to work for most shells in existence=C2=A0
(e.g.= , derivatives of POSIX sh, csh, zsh, etc.) and including the default shell.= =C2=A0

I agree it may be an option, but I disagree that it should be= off by default, given that the=C2=A0
default configured shell Ba= sh requires it.
--00000000000078b3ed06093a5ee3-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 03:26:57 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 07:26:57 +0000 Received: from localhost ([127.0.0.1]:56681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyoa0-0001QF-Qc for submit@debbugs.gnu.org; Fri, 03 Nov 2023 03:26:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyoZz-0001Q3-7l for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 03:26:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyoZJ-0001a1-Mb; Fri, 03 Nov 2023 03:26:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=T7cNvI5W4oMELps2P3KCv6sBNsY52nQSGDXbDE88S6Y=; b=RxMaTi+Exw4gx1NLkY04 uhdllnZH/w2zEXZw4xWPzbkDjDOJpuPIIswEFiPUzJJlPdP4mBTavXALV5Zvp5M4WD/f26kjMiDJB InuQO0xuPEth2DdVyJ/YXJDvSvOzV2AiDs3sLxXm/qRTdmyzQJSn233nHge0visc+5ZE4NKpubJnO ywCbd50L19blNriJsOwB7VavetDKg9ll3HeVcybLW7t5nXbxqwMRuhTPUZgNrSAShWgvOzkE935hE KU5QKJpfw1ik+5VLEwYoJSDy7KcyGBei/66v9HeA/dYHrsEAlF/D1qXx2Tg4iSc9PJsPAKhye5wz/ KW1XThp7xUPfLg==; Date: Fri, 03 Nov 2023 09:26:08 +0200 Message-Id: <83jzqz70xb.fsf@gnu.org> From: Eli Zaretskii To: Allen Li In-Reply-To: (message from Allen Li on Fri, 3 Nov 2023 00:22:26 -0700) Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes References: <83pm0r71e8.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Allen Li > Date: Fri, 3 Nov 2023 00:22:26 -0700 > Cc: 66903@debbugs.gnu.org > > On Fri, Nov 3, 2023 at 12:16 AM Eli Zaretskii wrote: > > "M-x shell" is not a shell, it is an Emacs interface to a shell. > Thus, it should be free to implement behavior not present in the > shell, if we consider it convenient for Emacs users. > > The behavior it is supposed to implement is that it tracks the working directory of the shell. > Currently, it fails to do so for most shells that a user would use. > In fact, it fails to do so for the default value `/bin/bash`. > > > 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). > > This is not a bug. I'm okay with adding a new optional feature that > would disable the above behavior, but it must be off by default. > > This is absolutely a bug. The feature, where shell-mode attempts to track the working > directory of its subshell, fails to work for most shells in existence > (e.g., derivatives of POSIX sh, csh, zsh, etc.) and including the default shell. > > I agree it may be an option, but I disagree that it should be off by default, given that the > default configured shell Bash requires it. I think we disagree about what should be fixed: the value of default-directory or the directory to which "cd ~//bin" switches. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 04:36:07 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 08:36:07 +0000 Received: from localhost ([127.0.0.1]:56724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qypew-0005uQ-VY for submit@debbugs.gnu.org; Fri, 03 Nov 2023 04:36:07 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:58764 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qypev-0005uI-77 for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 04:36:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1699000528; bh=AjRkRNdtRcbew75AFMafW9VFLZKQAwJpVMgnay/d1No=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=JSKargnUSMZLPTaxpHOAelKwYGxGpSIa403QbML+n2RQJCDxXmscA9H6eBAcjEoK5 v2ztjhA44+kldG2ADWhMi7jfqEkaUxqwMrQoEgU26ZHpAThYqF8EWbDDCL2GUY+v3W 3AfjgxBSnNngOLPgTM8L7awTmonSggOpVxR7iB7Xcg/MhC8YSmh49okbERuWA+XCR6 3K5I3HP2ME5NgdQ18SrDRQREEA4VfmKUERO0LIxngbEhjgULFMBQ/v1TEn/LMcZVvW e0zvtleQiVBGEmJrVe8FYPJqzCMkXL+ku26fx/KvMZaaPbdblqTxT4KfbyZkDpu76l Ax/wQMtVk509Q== From: Eshel Yaron To: Eli Zaretskii Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes In-Reply-To: <83jzqz70xb.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Nov 2023 09:26:08 +0200") References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> Date: Fri, 03 Nov 2023 09:35:26 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org, Allen Li X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Eli Zaretskii writes: >> From: Allen Li >> Date: Fri, 3 Nov 2023 00:22:26 -0700 >> Cc: 66903@debbugs.gnu.org >> >> On Fri, Nov 3, 2023 at 12:16=E2=80=AFAM Eli Zaretskii wro= te: >> >> "M-x shell" is not a shell, it is an Emacs interface to a shell. >> Thus, it should be free to implement behavior not present in the >> shell, if we consider it convenient for Emacs users. >> >> The behavior it is supposed to implement is that it tracks the working d= irectory of the shell. >> Currently, it fails to do so for most shells that a user would use. >> In fact, it fails to do so for the default value `/bin/bash`. >> >> > It looks like this should be fixed in `shell-cd` (which should also f= ix >> > `shell-process-pushd`) by implementing "custom" path handling (compar= ed >> > to Emacs default path handling behavior). >> >> This is not a bug. I'm okay with adding a new optional feature that >> would disable the above behavior, but it must be off by default. >> >> This is absolutely a bug. The feature, where shell-mode attempts to tra= ck the working >> directory of its subshell, fails to work for most shells in existence >> (e.g., derivatives of POSIX sh, csh, zsh, etc.) and including the defaul= t shell. >> >> I agree it may be an option, but I disagree that it should be off by def= ault, given that the >> default configured shell Bash requires it. > > I think we disagree about what should be fixed: the value of > default-directory or the directory to which "cd ~//bin" switches. IIUC what you're implying here is that "cd ~//bin" should actually switch the shell's current directory to /bin instead of ~/bin, is that right? I just wanted to note that this is not really an option with M-x shell, because it is the shell, and not Emacs, that interprets "cd" and changes directory. Emacs just tracks certain shell commands and tries to keep the buffer's `default-directory` up to date with the shell's directory. Best, Eshel From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 06:44:37 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 10:44:37 +0000 Received: from localhost ([127.0.0.1]:57057 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyrfF-0003nI-S6 for submit@debbugs.gnu.org; Fri, 03 Nov 2023 06:44:37 -0400 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:38336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyrfA-0003n0-9N for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 06:44:32 -0400 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2c6eac9c053so6079611fa.1 for <66903@debbugs.gnu.org>; Fri, 03 Nov 2023 03:43:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20230601.gappssmtp.com; s=20230601; t=1699008227; x=1699613027; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LDEjesFb37WmUp8lYQ8SbqD6ZOfayEEG41hemPfV55g=; b=goZaLi9PTY9hgCdhquBL69TRh4DPVOissYwrQzRxcYIgzut+DeAUW3bps83lXUY4I/ FKi0Cyenqpoxu2zVWPsTB6iBXYIZOpEZ4PQ8rtFYKgGyHI9uigszCfLip8+B3Cjxel+u 59KR8T8aC9uQR0irQcR376tJhYo+vAb+/o95iKPS7+wSPDP0xHSTg66qMqeaXt83b1BZ LRn8/zCOVb5eKaJ+WKYoquckHZngMMR2PraDdDGN/sjCHc/cinW8YDzjPLWeAG+AvY/2 naybr1qMUuTeuUXO+oksWdfz/YerAkln3cwLb5e43NjVEtvFV0V+IhIk8lIVq6y1m1I6 5ymg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699008227; x=1699613027; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LDEjesFb37WmUp8lYQ8SbqD6ZOfayEEG41hemPfV55g=; b=K8YwhVBZuW4bwvpc8dq5lFw5XDA5uZRisY8od9XYS/9ZMEUe3VNP9zbpJU+3bY7CdS 3Tpo1OAwjU0a7kZdb9PkkXjoR8+gjngYwNZ/xjy4TFOsyVW38DWde8w1nmXYtH2uJjMT 4VI5yS/41c99iUPB+gFWYGZtzFkfRaNfr7K9U2KP5yB+AU3kQt5lhzE5K83KUYGfcuL7 A6y7ipDQ5JtXrq/yzL3peI86qOXfqvR5/p9HhsMOBpDLxDP/+oKDD4uWd0+ZPClXbSTT QU73mqaH460x6I1wmmC49Ue2avJ6CEvNsdtWaDSnj8D5PiaZdKd9onHUGvlNgtKe+3HZ h/Cg== X-Gm-Message-State: AOJu0YzpfcpcrCbiNITKgCANMj4G2q+E6w4el5kyMewhaqeZ5sCY01kw 0GXn63iCgltCuG66gBFfQrGLfI44JSyV5ORjDJLXmA== X-Google-Smtp-Source: AGHT+IF+wNvD53ephwzBd6womznxlzg2UD6+ct8D9O+kOjC49mlVSW/EXP4cUnyQ4XxMQRimbCB+NsY/aif88OS09rY= X-Received: by 2002:a2e:8296:0:b0:2c5:409:7005 with SMTP id y22-20020a2e8296000000b002c504097005mr14893681ljg.4.1699008226634; Fri, 03 Nov 2023 03:43:46 -0700 (PDT) MIME-Version: 1.0 References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> In-Reply-To: <83jzqz70xb.fsf@gnu.org> From: Allen Li Date: Fri, 3 Nov 2023 03:43:35 -0700 Message-ID: Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000d1c3c006093d2d1f" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000d1c3c006093d2d1f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 3, 2023 at 12:26=E2=80=AFAM Eli Zaretskii wrote: > I think we disagree about what should be fixed: the value of > default-directory or the directory to which "cd ~//bin" switches. > Sorry, let me clarify Currently, `cd ~//bin` will cause the shell (Bash or similar) to change to ~/bin, and Emacs/shell-mode will change `default-directory` to `/bin`. This bug is saying that Emacs/shell-mode should change `default-directory` to `~/bin` by default, optionally with a user option that reverts to the current behavior in case the user has in fact explicitly configured to use a shell that interprets `cd ~//bin` to mean `cd /bin` (although I am not aware of any shells that do this (except eshell, which is not relevant to this issue)). I (mis?)interpreted your statement to mean that you think the current behavior is not a bug and should be the default (that Emacs/shell-mode should change `default-directory` to `/bin` even though the shell changes to ~/bin). --000000000000d1c3c006093d2d1f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Nov 3, 2023 at 12:26=E2=80=AFAM E= li Zaretskii <eliz@gnu.org> wrote= :
I think we disagree about what should be fixed: the value of
default-directory or the directory to which "cd ~//bin" switches.=

Sorry, let me clarify

Currently, `cd ~//bin` will cause the shell (Bash or similar) to c= hange=C2=A0to ~/bin, and Emacs/shell-mode will change `default-directory` t= o `/bin`.

This bug is saying that Emacs/shell-mode should change `de= fault-directory` to `~/bin` by default, optionally with a user option that = reverts to the current behavior in case the user has in fact explicitly con= figured to use a shell that interprets `cd ~//bin` to mean `cd /bin` (altho= ugh I am not aware of any shells that do this (except eshell, which is not = relevant to this issue)).

I (mis?)interpreted your statement to mean= that you think the current behavior is not a bug and should be the default= (that Emacs/shell-mode should change `default-directory` to `/bin` even th= ough the shell changes to ~/bin).
--000000000000d1c3c006093d2d1f-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 08:03:07 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 12:03:07 +0000 Received: from localhost ([127.0.0.1]:57227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qystH-00008D-7m for submit@debbugs.gnu.org; Fri, 03 Nov 2023 08:03:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46848) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qystG-00007g-3y for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 08:03:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyssa-00014W-MM; Fri, 03 Nov 2023 08:02:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IJJr1RSUfT+X6GXWMMAU3BKpDmgrP0kFYYV3Kz1/59I=; b=Y7vBhZYwVcDF uVnj7gjYltfZZ40jUvM7KMjuBNOms+7pOjTrJc4DDIeUcDEeiSuTDbNx1oKSbTMfkzYoWaj0RvWZI kbsk+xGuqWOvIRYU44eI4StqNkj1JA65qiquEVUKgZ9DsV26CccTZhCGDzsfbToZ6qeWG4lnYuUQ6 0HzEOYAbBk3HuBZAFgRzWIEUTN5UeFreHO7eengHX5Hy50N/0hdCoyfeiATwCyAUXZBAS7JFyPl7R vrvrlEYPxHHWit2oZpmk154dVl56TT4+cknYU+R5Cn5zj82rPveVD8dapOMCLe1hQCOhEamllgFgX FrUJIDbhA/U2x5W8iRLnmQ==; Date: Fri, 03 Nov 2023 14:02:19 +0200 Message-Id: <83fs1n6o50.fsf@gnu.org> From: Eli Zaretskii To: Eshel Yaron In-Reply-To: (message from Eshel Yaron on Fri, 03 Nov 2023 09:35:26 +0100) Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org, darkfeline@felesatra.moe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eshel Yaron > Cc: Allen Li , 66903@debbugs.gnu.org > Date: Fri, 03 Nov 2023 09:35:26 +0100 > > Eli Zaretskii writes: > > > I think we disagree about what should be fixed: the value of > > default-directory or the directory to which "cd ~//bin" switches. > > IIUC what you're implying here is that "cd ~//bin" should actually > switch the shell's current directory to /bin instead of ~/bin, is that > right? Yes. > I just wanted to note that this is not really an option with M-x shell, > because it is the shell, and not Emacs, that interprets "cd" and changes > directory. You assume that shell.el must send everything the user types verbatim to the shell? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 08:08:43 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 12:08:43 +0000 Received: from localhost ([127.0.0.1]:57232 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qysyh-0000Fx-1B for submit@debbugs.gnu.org; Fri, 03 Nov 2023 08:08:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qysya-0000Fc-22 for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 08:08:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qysxu-0002Yo-JP; Fri, 03 Nov 2023 08:07:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=OAe59f2oW0QSl5asqpHCwR1cf7uiqb1iIbPkQlM7Q3Y=; b=IQT7U6vE+zwT PSC31ADInJ2OkeBS9PxUqaRROI5hGLOtRa79i5rjmvE+uum9LzxZRG2PGg+WOX1yB3icsvV9cj10d 8s+49NrScvzY3IOfJRpTijJWDUWLwIxOZj4Zgqx7bDu6TTqiCJGa5n+qoRTHoJ2ntBuo+4xFgoTWJ UX6TVLHxWN3xGLpH61wnh1SY7se7g5Tf/yWaKX5jUJr2YMeSQRE7VguUBoKbKHhnS1ldpziHaU71j qY7AuZGnplRNf/63RRfRXDapsuMhKdLCJmWVm2h/sZ1IBeROHsaaGjjO4UfNDwmoPHkr2TK2ZyqhH hl/29N7iAYRpknpHI49P9g==; Date: Fri, 03 Nov 2023 14:07:46 +0200 Message-Id: <83cywr6nvx.fsf@gnu.org> From: Eli Zaretskii To: Allen Li In-Reply-To: (message from Allen Li on Fri, 3 Nov 2023 03:43:35 -0700) Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Allen Li > Date: Fri, 3 Nov 2023 03:43:35 -0700 > Cc: 66903@debbugs.gnu.org > > Currently, `cd ~//bin` will cause the shell (Bash or similar) to change to ~/bin, and Emacs/shell-mode > will change `default-directory` to `/bin`. > > This bug is saying that Emacs/shell-mode should change `default-directory` to `~/bin` by default, I think it should change default-directory to the directory to which the shell switches, not necessarily ~/bin. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 08:36:34 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 12:36:34 +0000 Received: from localhost ([127.0.0.1]:57258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qytPX-0000uK-LJ for submit@debbugs.gnu.org; Fri, 03 Nov 2023 08:36:33 -0400 Received: from mail.eshelyaron.com ([107.175.124.16]:43800 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qytPV-0000uB-8L for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 08:36:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1699014949; bh=0SVDXeA3kIbT5OymIY6pLUziSj4Tp4EOHFuiQMHpjcs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OsJTLk8+/756G1mvE13jPImTSf+uajyjxlcvrN1wIkeUXoAsHFiNPYjRPlTJa/xiL OHe4Vye97S9XmVvQvrPDIKZwdOM/PyZfb/oofUrXY80RntBm6HIDbcoZtZz24vUbmL Rmd2faOOtg5Vpacznib2i4FQxo/d1Q8MbGy8PbZlOsMhrxgW3MMf03/i4ZLCFAdDZY Ix0IFXlFvNy6JFeh+ItP4YNntmjWRStDvmAZgrjxizgyCgH7M0JrEQeDjS96siNhv5 geLBp8goPrGCa6PA+iVfPbs90NVeULusiIOi3Ad/2cCAoBt+jN9n/mvAZxwWYAYgi9 0XYponrw76W5A== From: Eshel Yaron To: Eli Zaretskii Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes In-Reply-To: <83fs1n6o50.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Nov 2023 14:02:19 +0200") References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> <83fs1n6o50.fsf@gnu.org> X-Hashcash: 1:20:231103:eliz@gnu.org::766D0SJQLLPr+2i5:uj+ X-Hashcash: 1:20:231103:66903@debbugs.gnu.org::SJ33TM+G0xVLz5Ve:1pjb X-Hashcash: 1:20:231103:darkfeline@felesatra.moe::t1uiimDFrWdB2jF+:22RQ Date: Fri, 03 Nov 2023 13:35:46 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org, darkfeline@felesatra.moe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: Allen Li , 66903@debbugs.gnu.org >> Date: Fri, 03 Nov 2023 09:35:26 +0100 >> >> Eli Zaretskii writes: >> >> > I think we disagree about what should be fixed: the value of >> > default-directory or the directory to which "cd ~//bin" switches. >> >> IIUC what you're implying here is that "cd ~//bin" should actually >> switch the shell's current directory to /bin instead of ~/bin, is that >> right? > > Yes. > >> I just wanted to note that this is not really an option with M-x shell, >> because it is the shell, and not Emacs, that interprets "cd" and changes >> directory. > > You assume that shell.el must send everything the user types verbatim > to the shell? No, not "must" and not "everything", but if you think about it intercepting "cd" and altering its argument would make `M-x shell` incompatible with other shell interfaces, breaking valid command lines in weird ways. Does that make sense? From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 10:25:30 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 14:25:30 +0000 Received: from localhost ([127.0.0.1]:59480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyv74-0004Fo-9d for submit@debbugs.gnu.org; Fri, 03 Nov 2023 10:25:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyv71-0004Fb-KY for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 10:25:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qyv6L-0003gx-VZ; Fri, 03 Nov 2023 10:24:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=b95chYYNqzBT0k2GXrMWliOW3e0Za824Is+ZeVaPbMc=; b=F5IFtl6kuSS2 VJ85fFc6Hef2M9+t4SybJLsCBhCQrUH5+0f4Z8BIp61JWD7fi1UAmY/xiWYAy4gfDDjD5uOD7JZkt rISHf9TKQq60f9ZCYuBm30C9fHWu5B6ZQ1O3VEp/9Fa7+nDttRLDEUZygnd6atMBOwUvDrQApkb9R /0zO4OcnfhhjUiKexRwheqLz/KFib/od5fqkvCu7+6GsvNtEK1x7NqXdIVvSYlkq0QXY1QCMFo8Hh dP+WwlGD5ugPVYNzeGCqzadyoRp6o5SyobFed9fUB9hXbc0Ok8Fp0679PUTC4huXQubf4FxoNJ4IV k/BuLNADrC1mKc/4nOSmkA==; Date: Fri, 03 Nov 2023 16:24:42 +0200 Message-Id: <83bkca7w45.fsf@gnu.org> From: Eli Zaretskii To: Eshel Yaron In-Reply-To: (message from Eshel Yaron on Fri, 03 Nov 2023 13:35:46 +0100) Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> <83fs1n6o50.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org, darkfeline@felesatra.moe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Eshel Yaron > Cc: darkfeline@felesatra.moe, 66903@debbugs.gnu.org > Date: Fri, 03 Nov 2023 13:35:46 +0100 > > Eli Zaretskii writes: > > >> I just wanted to note that this is not really an option with M-x shell, > >> because it is the shell, and not Emacs, that interprets "cd" and changes > >> directory. > > > > You assume that shell.el must send everything the user types verbatim > > to the shell? > > No, not "must" and not "everything", but if you think about it > intercepting "cd" and altering its argument would make `M-x shell` > incompatible with other shell interfaces, breaking valid command lines > in weird ways. Does that make sense? It does to me. To understand why, start Emacs in your HOME directory, and then type this: M-x cd RET ~//bin RET From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 16:55:06 2023 Received: (at 66903) by debbugs.gnu.org; 3 Nov 2023 20:55:06 +0000 Received: from localhost ([127.0.0.1]:59893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz1C5-0000jk-Fl for submit@debbugs.gnu.org; Fri, 03 Nov 2023 16:55:06 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]:39258) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz1C2-0000jC-Cy for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 16:55:03 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2c519eab81fso5875211fa.1 for <66903@debbugs.gnu.org>; Fri, 03 Nov 2023 13:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=felesatra-moe.20230601.gappssmtp.com; s=20230601; t=1699044860; x=1699649660; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=V2W9oaJcL01yBtiq9s4T41EsRiivv63oGfDLL+sHTNg=; b=t797CmWzMWVsgqMt6spy2iWyb3Y+2TAH7xXLAo7/qZoU0Y+GAt2bfkrMePc8/sHkr4 WYNQp7awOdOg/5aYijsXBR73GxmUV15+5lfqTXGTr7pmoyTQmW1HH0a/pdjzaNuHl60U pRuE0ZttexVE6lTyfXo7exHA2gIOiu9Ekg2MORihAYBukvPC7d98R4UvOftG32oQdAa9 ktz/LxW1MRN70eX3LXkR/wUgjgb5HzWdfcQOBZCtJzlA1ABTbWy8pBumfucoGGwgy+xV pAQXsUQCYm7DhAiZBJYD7N+ASRe4sV5Be7qCwk7chQeYgYOazaOgBNNqOgdXrKueibXv F8Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699044860; x=1699649660; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V2W9oaJcL01yBtiq9s4T41EsRiivv63oGfDLL+sHTNg=; b=J65UiV8CNPzKYNaYF8LtUz3WfVL63JSA2rO4/iJmhCI5E/Ji2Fw3aOIrIFE5DeZtl7 NGDqjBruqVFsKK6WfUsDuO6EXzyBO5qcnxmQFgFFPpAPOljcjUVvC5Jt01aR42NbN57z 9ECm1H8tKFBGfv255mGawkJzvd3LT23hX1TGKDiBb3kDuppuCxqWyqMqnw+gw5HjNBqH FZ4ucN7ifBlg1UBGp2WJAVwt967DhwuVlm3NK24Iikjv6M7SBYzE16vbBTXgtWfIG1Af MwpX5qGWGbiwTpQyzkR4DDyLG9HigowQTvdeUrTg6HiXdo5n+wULOhbYRedo6L66J33z zNnw== X-Gm-Message-State: AOJu0YxzNUHJUEYtLaZPI8lH0psdxbzwwvHFzGyQWTCxhu8KMwEc2fpZ rMpdldWR4YcZBoRRkzbteNMg8hjW3hW4yUf3nIfz9Q== X-Google-Smtp-Source: AGHT+IHLP2WKHkNH6H80U0CjQwDQpt/UNzOFAncu/bP6PIyExzcSnxS1USk1dfRD+q9o/sqDlibVEw37IqmW3xsUqXA= X-Received: by 2002:a2e:86c9:0:b0:2c5:36e:31bf with SMTP id n9-20020a2e86c9000000b002c5036e31bfmr16727594ljj.5.1699044860424; Fri, 03 Nov 2023 13:54:20 -0700 (PDT) MIME-Version: 1.0 References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> <83cywr6nvx.fsf@gnu.org> In-Reply-To: <83cywr6nvx.fsf@gnu.org> From: Allen Li Date: Fri, 3 Nov 2023 13:54:09 -0700 Message-ID: Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes To: Eli Zaretskii Content-Type: multipart/alternative; boundary="0000000000005d0a54060945b5db" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000005d0a54060945b5db Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Nov 3, 2023 at 5:07=E2=80=AFAM Eli Zaretskii wrote: > > From: Allen Li > > Date: Fri, 3 Nov 2023 03:43:35 -0700 > > Cc: 66903@debbugs.gnu.org > > > > Currently, `cd ~//bin` will cause the shell (Bash or similar) to change > to ~/bin, and Emacs/shell-mode > > will change `default-directory` to `/bin`. > > > > This bug is saying that Emacs/shell-mode should change > `default-directory` to `~/bin` by default, > > I think it should change default-directory to the directory to which > the shell switches, not necessarily ~/bin. > That sounds different from what you're implying in your other emails. Using sentences here is confusing. The current behavior is: Case 1 input: ~//bin shell: ~/bin default-directory: /bin I'm suggesting Case 2 input: ~//bin shell: ~/bin default-directory: ~/bin When you say "I think it should change default-directory to the directory to which the shell switches, not necessarily ~/bin.", that implies to me Case 2 But your other emails suggest that you want: Case 3 input: ~//bin (Emacs rewrites to /bin before sending to shell) shell: /bin default-directory: /bin Assuming that you want Case 3, I think that is horrible for multiple reasons. Firstly, a user would expect their shell to behave as in Case 2; Case 3 is a surprising and semantically different rewrite of user input. Furthermore, we would either have to rewrite all paths not just paths to `cd`, which would be infeasible and error-prone, or surprise the user again that Emacs is rewriting paths to `cd` specifically, but not, say, `rm` or `mv` or many other commands (e.g., `mv ~//bin ~//lib`). Furthermore, the only shell input rewriting that Emacs currently does is for history substitutions, and the syntax for this is identical to common shells; therefore, users can expect that Emacs does not do any surprising semantic rewrites of their shell input. Case 3 would be violating this expectation. For completeness, there is also Case 4 input: ~//bin shell: /bin (normal shell behavior) default-directory: /bin However, I am aware of zero shells in common use that behave like Case 4. Even if we consider it, it should not be the default. Also for completeness, there is a nuclear solution option, which is to replace all of the cd, pushd, popd logic that shell-mode currently implements and always run M-x dirs after every cd, pushd, popd command. This naturally results in the behavior of Case 2, but also supports Case 4 for hypothetical shells that have said behavior. --0000000000005d0a54060945b5db Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Nov 3, 2023 at 5:07=E2=80=AFAM El= i Zaretskii <eliz@gnu.org> wrote:=
> From: Allen Li <darkfeline@felesatra.moe>
> Date: Fri, 3 Nov 2023 03:43:35 -0700
> Cc: 66903@d= ebbugs.gnu.org
>
> Currently, `cd ~//bin` will cause the shell (Bash or similar) to chang= e to ~/bin, and Emacs/shell-mode
> will change `default-directory` to `/bin`.
>
> This bug is saying that Emacs/shell-mode should change `default-direct= ory` to `~/bin` by default,

I think it should change default-directory to the directory to which
the shell switches, not necessarily ~/bin.

<= div>That sounds different from what you're implying in your other email= s.=C2=A0 Using sentences here is confusing.

The cu= rrent behavior is:

Case 1
input: ~//bin<= /div>
shell: ~/bin
default-directory: /bin

I'm suggesting

Case 2
in= put: ~//bin
shell: ~/bin
=
default-directory: ~/bin

When you say &= quot;I think it should change default-directory to the directory to whichthe shell switches, not necessarily ~/bin.", that implies to me Ca= se 2

But your other ema= ils suggest that you want:

Case 3
input: ~//bin (Emacs rewrites to /bin bef= ore sending to shell)
shell: /= bin
default-directory: /bin
=C2=A0
Assu= ming that you want Case 3, I think that is horrible for multiple reasons.= =C2=A0 Firstly, a user would expect their shell to behave as in Case 2; Cas= e 3 is a surprising and semantically different rewrite of user input.=C2=A0= Furthermore, we would either have to rewrite all paths not just paths to `= cd`, which would be infeasible and error-prone, or surprise the user again = that Emacs is rewriting paths to `cd` specifically, but not, say, `rm` or `= mv` or many other commands (e.g., `mv ~//bin ~//lib`).=C2=A0 Furthermore, t= he only shell input rewriting that Emacs currently does is for history subs= titutions, and the syntax for this is identical to common shells; therefore= , users can expect that Emacs does not do any surprising semantic rewrites = of their shell input.=C2=A0 Case 3 would be violating this expectation.
=
For completeness, there is also

Case 4
i= nput: ~//bin
shell: /bin (norm= al shell behavior)
default-directory: /bin

However, I am aware of zero shells in common use that behave like = Case 4.=C2=A0 Even if we consider it, it should not be the default.

= Also for completeness, there is a nuclear solution option, which is to repl= ace all of the cd, pushd, popd logic that shell-mode currently implements a= nd always run M-x dirs after every cd, pushd, popd command.=C2=A0 This natu= rally results in the behavior of Case 2, but also supports Case 4 for hypot= hetical shells that have said behavior.
--0000000000005d0a54060945b5db-- From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 20:21:57 2023 Received: (at 66903) by debbugs.gnu.org; 4 Nov 2023 00:21:57 +0000 Received: from localhost ([127.0.0.1]:60101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz4QG-0002yx-JH for submit@debbugs.gnu.org; Fri, 03 Nov 2023 20:21:56 -0400 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]:55616) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz4QE-0002yh-0O for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 20:21:54 -0400 Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507b96095abso3267064e87.3 for <66903@debbugs.gnu.org>; Fri, 03 Nov 2023 17:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699057272; x=1699662072; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=PtprOijxgg4R+Fj4AdQ6egc9Fy2oeEPT9HgRoFox51E=; b=VVVDIeu1yhV30IouEvfY8t6Unl0ipOqphJUoi8q4hEKGqNcvwwXPTaRq5MR0f6W3xi TNC5tPMNEoRoh2fT9zAcvbUhE2ucZguBlr8i15YrW0J4fiQzHINpWv0eg6dTM4zymfZU eK8XZTz8oDd/18IZ1dteaMKZaDeitocHBcwi51Q60sjgQOITMXXZpUn+pawhCkwkokPl 5q1QPhHe2U1NcpiKSD9czCL4Hr+e9uw8wVKJ7gbxL6vhq6xEqp2u12jWc32Hn62LQD0g i6+gVgbvHO+ODqT1PsaqrRMoajMt506j92C9DlZETis9eIOOhXZizG0CUQhrQDlznYJ1 IQuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699057272; x=1699662072; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PtprOijxgg4R+Fj4AdQ6egc9Fy2oeEPT9HgRoFox51E=; b=tT1PqQ+u+8jY/e4Vmvlc1mzYWdWzDtFJ52sKsHj9YVqCtUeUQBmbJLT8z0aB66goTl Flo9VAoVUwjk3mAcW9WKGpygGhwcfhqPWn7QO0Oiid5RTVDNHt574t7a4DsEj7w3re1J ZlbLDWUxV3kKaG1TuTIpE69QQeNlGU+As4z1XD3ho5nPvTmBIPDMTEhp5BugDb0gzbw+ Y4fPVA8gGiv4UhVi8QHg4v8r5P+BJbtTyJ2l9uvemnqsy0FRA7cvYKTofuxcsxv2o8bj rSUdVbwvv4bW2B3E7U1FBT+vJ/DkMO0I8ZiMxxNcgpfY6bxora7/TpOiMSNxoHC+RIyP yzCg== X-Gm-Message-State: AOJu0Yx5xTfdRdqG6hCNh8Gks7zleCBMP5MuADKRP15+SSgYqKqWauAO s9J5L/RAwTG6QFF278tiVZcPVaFfJ0z/NDD7ER0= X-Google-Smtp-Source: AGHT+IEOfX0XGads1DZfnKUlYpVhWoq8byaMt/GMFFC6AfrgD3X9Eku0+4Xb9ytBNfx297hHRCwxRSSJcF0SXPQV/Ek= X-Received: by 2002:a05:6512:368f:b0:506:8d2a:5654 with SMTP id d15-20020a056512368f00b005068d2a5654mr15022359lfs.28.1699057272035; Fri, 03 Nov 2023 17:21:12 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 3 Nov 2023 17:21:11 -0700 From: Stefan Kangas In-Reply-To: <83bkca7w45.fsf@gnu.org> References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> <83fs1n6o50.fsf@gnu.org> <83bkca7w45.fsf@gnu.org> MIME-Version: 1.0 Date: Fri, 3 Nov 2023 17:21:11 -0700 Message-ID: Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes To: Eli Zaretskii , Eshel Yaron Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org, darkfeline@felesatra.moe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: darkfeline@felesatra.moe, 66903@debbugs.gnu.org >> Date: Fri, 03 Nov 2023 13:35:46 +0100 >> >> Eli Zaretskii writes: >> >> >> I just wanted to note that this is not really an option with M-x shell, >> >> because it is the shell, and not Emacs, that interprets "cd" and changes >> >> directory. >> > >> > You assume that shell.el must send everything the user types verbatim >> > to the shell? >> >> No, not "must" and not "everything", but if you think about it >> intercepting "cd" and altering its argument would make `M-x shell` >> incompatible with other shell interfaces, breaking valid command lines >> in weird ways. Does that make sense? > > It does to me. To understand why, start Emacs in your HOME directory, > and then type this: > > M-x cd RET ~//bin RET It would be highly dangerous to start mangling command lines to shells run under `M-x shell' in incompatible ways. Not to mention that such a change would be backwards-incompatible. Consider the command sudo rm -rf ~//usr This is not a contrived example, BTW, but more or less exactly a command I have run in the last year. I don't think I used //, but double slashes are always collapsed in POSIX, so I can't be sure. It's not something I look for that when cobbling together shell commands in POSIX-compatible shells (bash and zsh here). So I think we should not do that. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 03 22:54:06 2023 Received: (at 66903) by debbugs.gnu.org; 4 Nov 2023 02:54:06 +0000 Received: from localhost ([127.0.0.1]:60170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz6nW-0006tR-7g for submit@debbugs.gnu.org; Fri, 03 Nov 2023 22:54:06 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:49513) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qz6nU-0006sv-4X for 66903@debbugs.gnu.org; Fri, 03 Nov 2023 22:54:04 -0400 Received: by mail-pg1-x541.google.com with SMTP id 41be03b00d2f7-53fbf2c42bfso2039489a12.3 for <66903@debbugs.gnu.org>; Fri, 03 Nov 2023 19:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699066402; x=1699671202; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5+7X3pYR30y0wHwKTflTunpBXBVWBl8DXLOPpkB5ufc=; b=LVRDBtKAnW7sEtAZL3SJvMjFj/baZXQIm7vfUq4DSAHeESdnjBUNBz0//DWbgaHvFN 7sRDfcBCcWM3ISriYCzyFrmxrwV+5D/IZ6EoJ8QFXHIk3e3aVxuJmYgeYvIplXQfnl0Y ptlnFz95nmcLkLd4ILxb/8QG/jtfLFaSUUFLrLcpfn/rCIi+fDLiBzG2SDgzB3zs4O8y 4McGAr9LlXf3PW31zZuKhj22F/NmUZ2Ubad+ng7V/pc3Vdf28Jq1Ca5S0MlKwS+UO+dN Yj8imZRhxzAIOJ0FxbnLCxusYKcsPDWxIxIbzYY0yCmx/7avS/p+1V0aFIKWe8kaY7iE E9WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699066402; x=1699671202; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5+7X3pYR30y0wHwKTflTunpBXBVWBl8DXLOPpkB5ufc=; b=JmEDfC8x5KJdLkgtLqq9zgL1oBoDrrobrWII0b+oYpBajcVkROzJ9QOa/p7Pood8IE PLbll0n0LEihMARMWHU8gd9VoD2FyVyFz0EoI+la3AuFkDnsNioMPSMJhUJ45zbAXPTc 8j887F8NdwzZFdZXBNBJeEVb4B2WruVHKvHuiLCi+DYpjavveDCUvRdC0igrwgMgLI/N VFAbLojLccuwvvy7ETAFY7zU4Xzn9dI9q2zfOC9RF9IYQdicUGJsHHI51YbYxARQ4ciP tCm5ldmy1src18P7pMyTJxR4bIl1dTH+yEWi+1uxmzR/UA9lvpkCEDIBraTo4f3w1u24 89YQ== X-Gm-Message-State: AOJu0YyM83u41K6GkiAr5XMBYTrey5Sp8b2MlGMhe0gTmEVQh/lHv+d2 NtHBJEO52lDAzSBlqQM6+6iNAYFJCmgPWg== X-Google-Smtp-Source: AGHT+IEyP2oajnGfMez00T9rrBVCkOhbFbUEAIzxfwQ3bDwER8wJUMJr40zT4PV1xpNjAO4/l3djXw== X-Received: by 2002:a05:6a21:7803:b0:181:3129:363 with SMTP id be3-20020a056a21780300b0018131290363mr13148763pzc.58.1699066402332; Fri, 03 Nov 2023 19:53:22 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id e14-20020a17090ac20e00b00279163e52bbsm1939959pjt.17.2023.11.03.19.53.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 19:53:22 -0700 (PDT) From: Visuwesh To: Stefan Kangas Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes In-Reply-To: (Stefan Kangas's message of "Fri, 3 Nov 2023 17:21:11 -0700") References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> <83fs1n6o50.fsf@gnu.org> <83bkca7w45.fsf@gnu.org> Date: Sat, 04 Nov 2023 08:23:19 +0530 Message-ID: <871qd6fcv4.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org, Eli Zaretskii , Eshel Yaron , darkfeline@felesatra.moe X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) [=E0=AE=B5=E0=AF=86=E0=AE=B3=E0=AF=8D=E0=AE=B3=E0=AE=BF =E0=AE=A8=E0=AE=B5= =E0=AE=AE=E0=AF=8D=E0=AE=AA=E0=AE=B0=E0=AF=8D 03, 2023] Stefan Kangas wrote: > It would be highly dangerous to start mangling command lines to shells > run under `M-x shell' in incompatible ways. Not to mention that such a > change would be backwards-incompatible. Consider the command > > sudo rm -rf ~//usr > > This is not a contrived example, BTW, but more or less exactly a command > I have run in the last year. I don't think I used //, but double > slashes are always collapsed in POSIX, so I can't be sure. It's not > something I look for that when cobbling together shell commands in > POSIX-compatible shells (bash and zsh here). > > So I think we should not do that. A more common scenario I can think of is output of commands not sanitising the filenames to change the double slashes to a single slash. When you copy such a filename from the output to the comint prompt as part of a command and experience a different behaviour when you send the command, it would be annoying IMO. I copy the filename from the output precisely to avoid typing-and-editing, I don't want to do it more. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 04 02:34:54 2023 Received: (at 66903) by debbugs.gnu.org; 4 Nov 2023 06:34:54 +0000 Received: from localhost ([127.0.0.1]:60275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzAFC-0004Rb-64 for submit@debbugs.gnu.org; Sat, 04 Nov 2023 02:34:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qzAFA-0004RM-7F for 66903@debbugs.gnu.org; Sat, 04 Nov 2023 02:34:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qzAEU-0007kE-Mz; Sat, 04 Nov 2023 02:34:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=27fPFZVm39LDQx25ZLX1bgSCgSJ5sbIBUeYcnkHawVY=; b=qUZW+hnQyOCf k4pa+IUXfFbcL1j2aYQEqCz8cawI6TsxqBclLIug2gRl86mHX9cNpR9WM5v6pTJXvoWEqzffie5P7 /uWkhoQpqHUdP6x8TSbzHJ83/ZlqzLdatzqAUoQASa9Epd2tUBdoEQEuqBqAKn212mFjcYSFzdnO/ lqStMCsy1JZDDc7WmjtvCk5lVaThJyEHFCEgGpXA5uN3yDzv/A/BSlENCXBs26UVEhfT1wtq6tPAA nRjvNCWboJ0rcWhmqGw6NQxg4WLTHzQqQGr2HngPw5U3mAPsmbCB0u+obwA2ioiBi64C6+iJx0jf2 B1c1yq8I3jERLRjmU9abLw==; Date: Sat, 04 Nov 2023 08:34:07 +0200 Message-Id: <83y1fe58o0.fsf@gnu.org> From: Eli Zaretskii To: Allen Li In-Reply-To: (message from Allen Li on Fri, 3 Nov 2023 13:54:09 -0700) Subject: Re: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes References: <83pm0r71e8.fsf@gnu.org> <83jzqz70xb.fsf@gnu.org> <83cywr6nvx.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 66903 Cc: 66903@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Allen Li > Date: Fri, 3 Nov 2023 13:54:09 -0700 > Cc: 66903@debbugs.gnu.org > > That sounds different from what you're implying in your other emails. Using sentences here is > confusing. That's because your original report was confusing.