From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4855 invoked from network); 24 Sep 2006 07:11:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.5 (2006-08-29) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Sep 2006 07:11:43 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 34068 invoked from network); 24 Sep 2006 07:11:37 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Sep 2006 07:11:37 -0000 Received: (qmail 5740 invoked by alias); 24 Sep 2006 07:11:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22767 Received: (qmail 5722 invoked from network); 24 Sep 2006 07:11:32 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 24 Sep 2006 07:11:32 -0000 Received: (qmail 33677 invoked from network); 24 Sep 2006 07:11:32 -0000 Received: from flock1.newmail.ru (80.68.241.157) by a.mx.sunsite.dk with SMTP; 24 Sep 2006 07:11:32 -0000 Received: (qmail 11240 invoked from network); 24 Sep 2006 07:11:31 -0000 Received: from unknown (HELO cooker.local) (arvidjaar@newmail.ru@85.141.101.104) by smtpd.newmail.ru with SMTP; 24 Sep 2006 07:11:31 -0000 From: Andrey Borzenkov To: zsh-workers@sunsite.dk, David Madore , 389111-forwarded@bugs.debian.org Subject: Re: Bug#389111: autocompletion fails on non-printable characters in directories Date: Sun, 24 Sep 2006 11:11:21 +0400 User-Agent: KMail/1.9.4 References: <20060923230155.GA19190@clipper.ens.fr> <20060924014228.GA10845@scowler.net> In-Reply-To: <20060924014228.GA10845@scowler.net> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200609241111.28984.arvidjaar@newmail.ru> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday 24 September 2006 05:42, Clint Adams wrote: > > zsh seems to autocomplete non-printable characters by representing > > them as something like $'\377', but then it fails to understand them > > when autocompleting one further level of directories. > > > > For example, suppose we start in an empty directory (/tmp/test, say) > > and use no config file at all (cd /tmp/test; HOME=`pwd` zsh), just to > > make sure we load only the base completion module: then try > > > > % export LC_ALL=C > > % mkdir "`/usr/bin/printf 'x\\377z'`" > > % touch "`/usr/bin/printf 'x\\377z'`"/corge > > % cat x$'\377'z/ > > > > It will complete so far (if you type x, it completes to > > x$'\377'z/ as shown above), but no further (the "corge" part never > > appears). > > x$'\377'z is getting munged to "x$\\377z" and then matching > [^][*?#^\|\<\>\\]#(\`[^\`]#\`|\$)*/* in _path_files. Even worse: {pts/2}% ll $'xTAB {pts/2}% ll $X11HOME/ Completing parameter X11HOME XAUTHORITY XCURSOR_THEME XDG_CONFIG_DIRS XDM_MANAGED XkbModel XMODIFIERS While {pts/2}% print $'x quote> The quote is apparently removed in calcompfunc(): tmp = (linwhat == IN_MATH ? dupstring(s) : multiquote(s, 0)); and similar. $'...' is treated as yet another kind of quoting by the rest of zsh but not completion. It maintains quoting stack in compqstack; but this is one-character per quoting level. If we agree to denote quoting for $'...' as '$' it may be possible to squeeze in current code. - -andrey -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQFFFi+gR6LMutpd94wRAsmLAKDHEqZsBEajXiCOV9m85DkmaldCFgCgqZ1i HtOkL5uoW1FLU/VSClxgr/c= =C992 -----END PGP SIGNATURE-----