DIR/*<tab> expansion doesn't work with directories with apostrophe in the name

Bug #687461 reported by Hrvoje Nikšić
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zsh
New
Undecided
auto-zsh-workers
zsh (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: zsh

When the directory contains a single quote (apostrophe) in its name, pressing the tab key to expand dir/* into a list of files no longer works. What happens instead is that the tab key doesn't do anything while cursor is inside the dir/* word.

This worked as expected in previous versions of zsh. In zsh 4.3.10 (specifically 4.3.10-14ubuntu1, Ubuntu maverick) it works for directories without apostrophes in the name. I discovered it while trying to choose mp3s to queue in a music player, with the mp3s residing in a directory with apostrophe in the name.

Here is a recipe to repeat the bug:

$ zsh -f
mulj% mkdir "a'b"
mulj% touch "a'b"/{1,2,3}
mulj% ls a\'b/* # press TAB with cursor immediately after the *, nothing happens
# pressing enter correctly executes the (expanded) command:
a'b/1 a'b/2 a'b/3
mulj% mv a\'b ab
mulj% ls ab/* # now pressing TAB with cursor immediately after the * correctly
                                          # expands ab/* to ab/1 ab/2 ab/3
mulj% ls ab/1 ab/2 ab/3

Axel Beckert (xtaran)
Changed in zsh (Ubuntu):
status: New → Confirmed
Revision history for this message
Axel Beckert (xtaran) wrote :

This only happens with the built-in (and limited) expand-word expansion. You need to load the compinit completion system and another expansion module to make it work:

→ zsh -f
kiva6% ls -l a\'b
total 0
-rw-r--r-- 1 abe abe 0 Jan 18 01:44 1
-rw-r--r-- 1 abe abe 0 Jan 18 01:44 2
-rw-r--r-- 1 abe abe 0 Jan 18 01:44 3
kiva6% autoload -Uz compinit
kiva6% compinit
kiva6% zstyle ':completion:*' completer _expand _complete _ignored
kiva6% ls a\'b/*<Tab>
a\'b/1 a\'b/2 a\'b/3
a\'b/* a\'b/1 a\'b/2 a\'b/3

See also http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=32278 and following mails, especially http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=32281

Works at least with zsh 5.0.5-1 from Debian Testing.

Changed in zsh (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

  • auto-zsh-workers Edit

Bug watches keep track of this bug in other bug trackers.