zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: <zsh-workers@zsh.org>
Subject: Re: Unquoted "-" tokenization broke glob_complete
Date: Thu, 3 Jan 2019 12:40:50 +0000	[thread overview]
Message-ID: <1546519250.4189.10.camel@samsung.com> (raw)
In-Reply-To: <20190103120751.thttr6b3wxzkm5xw@hocevar.net>

On Thu, 2019-01-03 at 13:07 +0100, Sam Hocevar wrote:
> Commit f3f8537cfa05414ad14494e809d9ebfeef86ebbc [1] broke autocompletion
> when a directory name contains a hyphen and glob_complete is active.

You're talking about old-fashioned completion when the shell comes up
raw (apart from GLOB_COMPLETE), without the completion system loaded,
right?

We've been gradually picking up these Dash problems for some time now.
It was added to be able to emulate sh pattern matching better, which is
irrelevant and (as you've found) occasionally annoying in native mode.
I'm seriously wondering if the right fix for such issues in the future
isn't simply to give up on complete compatibility for sh-style patterns
but just document the issues --- there are things that zsh really isn't
equipped to do.

pws

diff --git a/Src/Zle/compctl.c b/Src/Zle/compctl.c
index 87d13af..fe87409 100644
--- a/Src/Zle/compctl.c
+++ b/Src/Zle/compctl.c
@@ -3256,6 +3256,15 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 	rpl = strlen(rpre);
 	rsl = strlen(rsuf);
     }
+    else
+    {
+	for (p = rpre; *p; ++p)
+	    if (*p == Dash)
+		*p = '-';
+	for (p = rsuf; *p; ++p)
+	    if (*p == Dash)
+		*p = '-';
+    }
     untokenize(lpre);
     untokenize(lsuf);
 


      reply	other threads:[~2019-01-03 12:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190103121454epcas3p4e581fa9f1880f6453e1696415bb459a4@epcas3p4.samsung.com>
2019-01-03 12:07 ` Sam Hocevar
2019-01-03 12:40   ` Peter Stephenson [this message]

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=1546519250.4189.10.camel@samsung.com \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).