Subject: Re: bug#65431: 30.0.50; pcomplete should not quote everything in a file name

From: Michael Albinus <[email-masked]>
Date: Mon, 21 Aug 2023 21:09:35 +0200

Jim Porter <[email-masked]> writes:

Hi Jim,

> I believe the problem is actually the *left* square bracket. Both
> square brackets should be quoted; otherwise, [...] gets treated as a
> glob. I'm a little surprised that the tab-completion even works here;
> I guess it's more forgiving than it should be. However, if you type
> "cd /\[ssh/loca TAB", it should work correctly.

Indeed, I didn't think about glob chars. Quoting them works fine.

> I see a couple of options:
>
> 1) Could Pcomplete fix the unquoted "[" for us? *Should* it?
>
> 2) I see that Pcomplete fails if you try to quote the whole file name,
> like "cd '/[ssh:loca TAB". Maybe we should fix that. Then users could
> rely on quoting with ' or " to escape the special glob characters
> instead.

Since glob chars are an eshell feature, I believe we could leave it as
it is. It is even documented in the eshell manual. If we add the square
brackets to the speacial characters of remote file names, we could close
the bug I believe. Something like

--8<---------------cut here---------------start------------->8---
This is needed especially for file names with special characters like
pipe (‘|’) or square brackets ('[' or ']'), which could be part of
remote file names.
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.