zsh compinit breaks with KSH_ARRAYS, KSH_GLOB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zsh (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
After upgrading to wily, trying to Tab autocomplete prints a bunch of errors.
It seems that
if [[ -z "$skip_
autoload -U compinit
compinit
fi
in /etc/zsh/zshrc, and the completion rules it loads from /usr/share/
Repro:
---
sudo useradd -m zshtest
sudo su - zshtest
cat >.zshrc <<EOF
emulate sh
setopt KSH_ARRAYS
setopt KSH_GLOB
EOF
sudo su - zshtest
cd /<TAB>
mikel-study% cd /
_all_labels:63: bad math expression: operator expected at `funcstack ...'
_description:63: bad math expression: operator expected at `comp_ignor...'
_path_files:63: bad math expression: operator expected at `pfx '
_path_files:63: bad math expression: operator expected at `prepaths '
_path_files:63: bad math expression: operator expected at `ignore '
_path_files:63: bad math expression: operator expected at `ignore'
_main_complete:338: bad math expression: operator expected at `lastdescr'
_main_complete:377: bad math expression: operator expected at `comp_color...'
---
Putting skip_global_
I imagine my set up is unsupported, but I notice that /usr/share/
---
emulate -L zsh
setopt extendedglob
---
One pattern that seems likely to be problematic is the dynamic definition of functions inside other functions, such as _next_tags creating _all_labels inside its body, which presumably uses the current shell options rather than the ones the completions assume are active.
$ dpkg -S /etc/zsh/zshrc /usr/share/
zsh-common: /etc/zsh/zshrc
zsh-common: /usr/share/
$ apt-cache show zsh-common
Package: zsh-common
Priority: optional
Section: shells
Installed-Size: 11882
Maintainer: Ubuntu Developers <email address hidden>
Original-
Architecture: all
Source: zsh
Version: 5.1.1-1ubuntu1
Oops, my repro left out
sudo chsh -s /bin/zsh zshtest
between lines 1 and 2, and
exit
after "EOF" and before the second "sudo su - zshtest".