GNU bug report logs - #66903
29.1; shell-mode directory tracking incorrectly handles double slashes

Previous Next

Package: emacs;

Reported by: Allen Li <darkfeline <at> felesatra.moe>

Date: Fri, 3 Nov 2023 00:16:01 UTC

Severity: wishlist

Found in version 29.1

Full log


View this message in rfc822 format

From: Visuwesh <visuweshm <at> gmail.com>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 66903 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, Eshel Yaron <me <at> eshelyaron.com>, darkfeline <at> felesatra.moe
Subject: bug#66903: 29.1; shell-mode directory tracking incorrectly handles double slashes
Date: Sat, 04 Nov 2023 08:23:19 +0530
[வெள்ளி நவம்பர் 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.




This bug report was last modified 1 year and 224 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.