zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#389111: autocompletion fails on non-printable characters in directories
       [not found] <20060923230155.GA19190@clipper.ens.fr>
@ 2006-09-24  1:42 ` Clint Adams
  2006-09-24  7:11   ` Andrey Borzenkov
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2006-09-24  1:42 UTC (permalink / raw)
  To: zsh-workers; +Cc: David Madore, 389111-forwarded

> 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<TAB>, 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.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug#389111: autocompletion fails on non-printable characters in directories
  2006-09-24  1:42 ` Bug#389111: autocompletion fails on non-printable characters in directories Clint Adams
@ 2006-09-24  7:11   ` Andrey Borzenkov
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Borzenkov @ 2006-09-24  7:11 UTC (permalink / raw)
  To: zsh-workers, David Madore, 389111-forwarded

-----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<TAB>, 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-----


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-09-24  7:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20060923230155.GA19190@clipper.ens.fr>
2006-09-24  1:42 ` Bug#389111: autocompletion fails on non-printable characters in directories Clint Adams
2006-09-24  7:11   ` Andrey Borzenkov

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).