Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Compctl Bug.



I have found a bug in Zsh 2.6-beta12 that relates to compctl. Here is a
script which illustrates the bug:


        $ echo $ZSH_VERSION
        2.6-beta12
        $ ls
        xxx.o/  yyy.c   yyy.o
        $ ls ^*.[oa](^/)
        yyy.c
        $ compctl -g '^*.[oa](^/)' vi
        $ vi yyy^D                      # Ctrl-D was pressed to see possibilities
        yyy.c
        $ vi yyy^U                      # Ctrl-U was pressed to erase the line
        $ vi xxx^D                      # Ctrl-D was pressed to see possibilities
        xxx.o
        $ vi xxx^U                      # Ctrl-U was pressed to erase the line
        $ touch xxx.c
        $ vi xxx^D                      # Ctrl-D was pressed to see possibilities
        xxx.c
        $ vi xxx^U                      # Ctrl-U was pressed to erase the line
        $ ls ^*.[oa](^/)
        xxx.c   yyy.c
        $ 


You will notice that the pattern "^*.[oa](^/)" does not match the .o
files or directories when used with ls, but when used with compctl, the
.o files are matched if there is not a correct match.


Thanks,


Brian


P.S.  Here is my output from the reporter script:

------------------------------ Cut Here ------------------------------
# START zsh saveset
# uname:  SunOS rainier 4.1.3 1 sun4m

# Aliases.

alias GL='\'| grep -v Makefile | less\''
alias H='\'| head\''
alias L='\'| less\''
alias T='\'| tail -f\''
alias lo='exit'
alias lpr='\'lpr -h\''
alias lprd='lpr2'
alias ls='\'ls -ACF\''
alias lsc='\'ls *.c(^@)\''
alias rotd='\'pushd +1\''
alias run-help='man'
alias sd='\'setenv DISPLAY\''
alias tmt='\'mt -f /dev/rst0\''
alias which-command='whence'
alias xterm='\'xterm -sb -sl 256 -T `hostname` -n `hostname`\''

# Key bindings.

bindkey -r "^@"
bindkey -r "^A"
bindkey -r "^B"
bindkey -r "^C"
bindkey -r "^D"
bindkey -r "^E"
bindkey -r "^F"
bindkey -r "^G"
bindkey -r "^H"
bindkey -r "^I"
bindkey -r "^J"
bindkey -r "^K"
bindkey -r "^L"
bindkey -r "^M"
bindkey -r "^N"
bindkey -r "^O"
bindkey -r "^P"
bindkey -r "^Q"
bindkey -r "^R"
bindkey -r "^S"
bindkey -r "^T"
bindkey -r "^U"
bindkey -r "^V"
bindkey -r "^W"
bindkey -r "^X"
bindkey -r "^Y"
bindkey -r "^Z"
bindkey -r "\e"
bindkey -r "^_"
bindkey -r "^?"
bindkey -r "^X^B"
bindkey -r "^X^F"
bindkey -r "^X^J"
bindkey -r "^X^K"
bindkey -r "^X^N"
bindkey -r "^X^O"
bindkey -r "^X^U"
bindkey -r "^X^V"
bindkey -r "^X^X"
bindkey -r "^X*"
bindkey -r "^XG"
bindkey -r "^Xg"
bindkey -r "^Xr"
bindkey -r "^Xs"
bindkey -r "^Xu"
bindkey -r "\e^D"
bindkey -r "\e^G"
bindkey -r "\e^H"
bindkey -r "\e^I"
bindkey -r "\e^J"
bindkey -r "\e^L"
bindkey -r "\e^M"
bindkey -r "\e^_"
bindkey -r "\e "
bindkey -r "\e!"
bindkey -r "\e\""
bindkey -r "\e$"
bindkey -r "\e'"
bindkey -r "\e-"
bindkey -r "\e."
bindkey -r "\e0"
bindkey -r "\e1"
bindkey -r "\e2"
bindkey -r "\e3"
bindkey -r "\e4"
bindkey -r "\e5"
bindkey -r "\e6"
bindkey -r "\e7"
bindkey -r "\e8"
bindkey -r "\e9"
bindkey -r "\e<"
bindkey -r "\e>"
bindkey -r "\e?"
bindkey -r "\eA"
bindkey -r "\eB"
bindkey -r "\eC"
bindkey -r "\eD"
bindkey -r "\eF"
bindkey -r "\eG"
bindkey -r "\eH"
bindkey -r "\eL"
bindkey -r "\eN"
bindkey -r "\eP"
bindkey -r "\eQ"
bindkey -r "\eS"
bindkey -r "\eT"
bindkey -r "\eU"
bindkey -r "\eW"
bindkey -r "\e[10~"
bindkey -r "\e[3~"
bindkey -r "\e[4~"
bindkey -r "\e[7~"
bindkey -r "\e[8~"
bindkey -r "\e[9~"
bindkey -r "\e[A"
bindkey -r "\e[B"
bindkey -r "\e[C"
bindkey -r "\e[D"
bindkey -r "\e_"
bindkey -r "\ea"
bindkey -r "\eb"
bindkey -r "\ec"
bindkey -r "\ed"
bindkey -r "\ef"
bindkey -r "\eg"
bindkey -r "\eh"
bindkey -r "\el"
bindkey -r "\en"
bindkey -r "\ep"
bindkey -r "\eq"
bindkey -r "\es"
bindkey -r "\et"
bindkey -r "\eu"
bindkey -r "\ew"
bindkey -r "\ex"
bindkey -r "\ey"
bindkey -r "\ez"
bindkey -r "\e|"
bindkey -r "\e^?"

bindkey "^@"	set-mark-command
bindkey "^A"	beginning-of-line
bindkey "^B"	backward-char
bindkey "^C"	undefined-key
bindkey "^D"	delete-char-or-list
bindkey "^E"	end-of-line
bindkey "^F"	forward-char
bindkey "^G"	send-break
bindkey "^H"	backward-delete-char
bindkey "^I"	expand-or-complete
bindkey "^J"	accept-line
bindkey "^K"	kill-line
bindkey "^L"	clear-screen
bindkey "^M"	accept-line
bindkey "^N"	down-line-or-history
bindkey "^O"	accept-line-and-down-history
bindkey "^P"	up-line-or-history
bindkey "^Q"	push-line
bindkey "^R"	history-incremental-search-backward
bindkey "^S"	history-incremental-search-forward
bindkey "^T"	transpose-chars
bindkey "^U"	kill-whole-line
bindkey "^V"	quoted-insert
bindkey "^W"	backward-kill-word
bindkey "^X"	prefix
bindkey "^Y"	yank
bindkey "^Z"	undefined-key
bindkey "\e"	prefix
bindkey "^_"	undo
bindkey "^?"	delete-char
bindkey "^X^B"	vi-match-bracket
bindkey "^X^F"	vi-find-next-char
bindkey "^X^J"	vi-join
bindkey "^X^K"	kill-buffer
bindkey "^X^N"	infer-next-history
bindkey "^X^O"	overwrite-mode
bindkey "^X^U"	undo
bindkey "^X^V"	vi-cmd-mode
bindkey "^X^X"	exchange-point-and-mark
bindkey "^X*"	expand-word
bindkey "^XG"	list-expand
bindkey "^Xg"	list-expand
bindkey "^Xr"	history-incremental-search-backward
bindkey "^Xs"	history-incremental-search-forward
bindkey "^Xu"	undo
bindkey "\e^D"	list-choices
bindkey "\e^G"	send-break
bindkey "\e^H"	backward-kill-word
bindkey "\e^I"	self-insert-unmeta
bindkey "\e^J"	self-insert-unmeta
bindkey "\e^L"	clear-screen
bindkey "\e^M"	self-insert-unmeta
bindkey "\e^_"	copy-prev-word
bindkey "\e "	expand-history
bindkey "\e!"	expand-history
bindkey "\e\""	quote-region
bindkey "\e$"	spell-word
bindkey "\e'"	quote-line
bindkey "\e-"	neg-argument
bindkey "\e."	insert-last-word
bindkey "\e0"	digit-argument
bindkey "\e1"	digit-argument
bindkey "\e2"	digit-argument
bindkey "\e3"	digit-argument
bindkey "\e4"	digit-argument
bindkey "\e5"	digit-argument
bindkey "\e6"	digit-argument
bindkey "\e7"	digit-argument
bindkey "\e8"	digit-argument
bindkey "\e9"	digit-argument
bindkey "\e<"	beginning-of-buffer-or-history
bindkey "\e>"	end-of-buffer-or-history
bindkey "\e?"	which-command
bindkey "\eA"	accept-and-hold
bindkey "\eB"	backward-word
bindkey "\eC"	capitalize-word
bindkey "\eD"	kill-word
bindkey "\eF"	forward-word
bindkey "\eG"	get-line
bindkey "\eH"	run-help
bindkey "\eL"	down-case-word
bindkey "\eN"	history-search-forward
bindkey "\eP"	history-search-backward
bindkey "\eQ"	push-line
bindkey "\eS"	spell-word
bindkey "\eT"	transpose-words
bindkey "\eU"	up-case-word
bindkey "\eW"	copy-region-as-kill
bindkey "\e[10~"	delete-word
bindkey "\e[3~"	beginning-of-line
bindkey "\e[4~"	end-of-line
bindkey "\e[7~"	backward-word
bindkey "\e[8~"	forward-word
bindkey "\e[9~"	backward-delete-word
bindkey "\e[A"	up-line-or-history
bindkey "\e[B"	down-line-or-history
bindkey "\e[C"	forward-char
bindkey "\e[D"	backward-char
bindkey "\e_"	insert-last-word
bindkey "\ea"	accept-and-hold
bindkey "\eb"	backward-word
bindkey "\ec"	capitalize-word
bindkey "\ed"	kill-word
bindkey "\ef"	forward-word
bindkey "\eg"	get-line
bindkey "\eh"	run-help
bindkey "\el"	down-case-word
bindkey "\en"	history-search-forward
bindkey "\ep"	history-search-backward
bindkey "\eq"	push-line
bindkey "\es"	spell-word
bindkey "\et"	transpose-words
bindkey "\eu"	up-case-word
bindkey "\ew"	copy-region-as-kill
bindkey "\ex"	execute-named-cmd
bindkey "\ey"	yank-pop
bindkey "\ez"	execute-last-named-cmd
bindkey "\e|"	vi-goto-column
bindkey "\e^?"	backward-kill-word

# Completions.

compctl -b bindkey
compctl -c builtin
compctl -g '.*(-/) *(-/)' cd
compctl -g '.*(/) *(/)' dircmp
compctl -v export
compctl -g '^*.[oa]' less
compctl -g '^*.[oa]' mcr
compctl -g '.*(-/) *(-/)' pushd
compctl -g '.*(^/) *(^/)' -x 'r[-rf,;]' -g '.*(-/) *(-/)' -- rm
compctl -g '.*(/) *(/)' rmdir
compctl -o setopt
compctl -u -x 'w[2,-c] p[3,-1]' -l '' -- su
compctl -v typeset
compctl -v unset
compctl -o unsetopt
compctl -v vared
compctl -g '^*.[oa](^/)' vi
compctl -c which
compctl -C -c
compctl -D -f
compctl -T

# Undefined functions.


# Defined functions.

lman () {
	for i in $*
	do
		groff -man -Tascii $i | less
	done
}
lms () {
	for i in $*
	do
		groff -ms -Tascii $i | less
	done
}
lpr2 () {
	lj2 $* | lpr -h
}
print () {
	/usr/5bin/pr -f -l90 $* | cat ~/prt - ~/prt.rst | lpr -h
}

# Limits.

limit stacksize       8MB
limit descriptors     64

# Non-array variables.

TERMCAP=''
TERM='xterm'
grep: Unbalanced [
prompt='test%'

# Array variables.

argv=()
grep: Unbalanced [

# Exported variables.

export TERMCAP
export TERM
grep: Unbalanced [

# Setopt.

setopt automenu
setopt correct
setopt extendedglob
setopt hashcmds
setopt hashdirs
setopt hashlistall
setopt notify

# END zsh saveset
------------------------------ Cut Here ------------------------------


-- 
Brian Dockter   (KC7JZL)         | Email: brian@xxxxxxx
Sr. Software Engineer            | Voice: 206-524-0014
Northwest Digital Systems        | FAX: 206-524-3440



Messages sorted by: Reverse Date, Date, Thread, Author