From: Stefan Kangas <stefankangas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, Eshel Yaron <me@eshelyaron.com>
Cc: 66903@debbugs.gnu.org, darkfeline@felesatra.moe
Subject: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes
Date: Fri, 3 Nov 2023 17:21:11 -0700 [thread overview]
Message-ID: <CADwFkm=S+g711whjJBY6x2_OCO8uERjPBLcyoYxbCTwdRtUhAw@mail.gmail.com> (raw)
In-Reply-To: <83bkca7w45.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Eshel Yaron <me@eshelyaron.com>
>> Cc: darkfeline@felesatra.moe, 66903@debbugs.gnu.org
>> Date: Fri, 03 Nov 2023 13:35:46 +0100
>>
>> Eli Zaretskii <eliz@gnu.org> 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.
next prev parent reply other threads:[~2023-11-04 0:21 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
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 [this message]
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='CADwFkm=S+g711whjJBY6x2_OCO8uERjPBLcyoYxbCTwdRtUhAw@mail.gmail.com' \
--to=stefankangas@gmail.com \
--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.