all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66903@debbugs.gnu.org, Allen Li <darkfeline@felesatra.moe>
Subject: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes
Date: Fri, 03 Nov 2023 09:35:26 +0100	[thread overview]
Message-ID: <m1cywrfd4h.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <83jzqz70xb.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 03 Nov 2023 09:26:08 +0200")

Hi,

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Allen Li <darkfeline@felesatra.moe>
>> 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 <eliz@gnu.org> 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.

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





  reply	other threads:[~2023-11-03  8:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-03  0:14 bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes Allen Li
2023-11-03  7:15 ` Eli Zaretskii
2023-11-03  7:22   ` Allen Li
2023-11-03  7:26     ` Eli Zaretskii
2023-11-03  8:35       ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-11-03 12:02         ` Eli Zaretskii
2023-11-03 12:35           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-03 14:24             ` Eli Zaretskii
2023-11-04  0:21               ` Stefan Kangas
2023-11-04  2:53                 ` Visuwesh
2023-11-03 10:43       ` Allen Li
2023-11-03 12:07         ` Eli Zaretskii
2023-11-03 20:54           ` Allen Li
2023-11-04  6:34             ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1cywrfd4h.fsf@dazzs-mbp.home \
    --to=bug-gnu-emacs@gnu.org \
    --cc=66903@debbugs.gnu.org \
    --cc=darkfeline@felesatra.moe \
    --cc=eliz@gnu.org \
    --cc=me@eshelyaron.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.