* Completion after zle doesn't work
@ 2002-02-27 17:13 Peter Stephenson
2002-03-01 5:07 ` Bart Schaefer
0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2002-02-27 17:13 UTC (permalink / raw)
To: Zsh hackers list
% zsh -f
% autoload -U compinit
% compinit -d
% zle ^D
hangs until I type ^C. Unfortunately ^X? does something even more
disastrous (seems to mess up the tty), but I did get a 1/2 MB output
before the shell completely stopped responding. I won't send it unless
somebody asks for it, but one thing that's worrying is
+_all_labels:27> _comp_tags= widgets widgets widgets widgets widgets ...
etc.
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Completion after zle doesn't work
2002-02-27 17:13 Completion after zle doesn't work Peter Stephenson
@ 2002-03-01 5:07 ` Bart Schaefer
0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2002-03-01 5:07 UTC (permalink / raw)
To: Peter Stephenson, Zsh hackers list
On Feb 27, 5:13pm, Peter Stephenson wrote:
} Subject: Completion after zle doesn't work
}
} hangs until I type ^C. Unfortunately ^X? does something even more
} disastrous (seems to mess up the tty), but I did get a 1/2 MB output
The zle completion bug was introduced by Oliver in 16464. There's an
infinite loop in _zle:
while (( $#state )); do
# ...
(widget*)
_wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0
[[ $st != *function ]] && continue
;& # ^^^^^^^^ Ooops!
(function)
_wanted -C "$context[1]" functions expl 'widget shell function' \
compadd -k functions && ret=0
;;
# ...
esac
16464 removed `local st' but this code is still testing it and looping.
I'm not sure exactly what's going on with ^X? there -- it appears that
the interrupt is not being handled correctly; you can break out of the
loop only when not doing _complete_debug.
Anyway, here's the minimalist patch for _zle, but I'm not sure that it
couldn't be done more cleanly some other way.
Index: _zle
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-4.0/Completion/Zsh/Command/_zle,v
retrieving revision 1.2
diff -c -r1.2 _zle
--- _zle 2002/02/04 19:48:20 1.2
+++ _zle 2002/03/01 05:03:51
@@ -46,9 +46,9 @@
;;
(widget*)
_wanted -C "$context[1]" widgets expl widget compadd -k widgets && ret=0
- [[ $st != *function ]] && continue
;&
(function)
+ [[ $state[1] != *function ]] || # Handle fall-through
_wanted -C "$context[1]" functions expl 'widget shell function' \
compadd -k functions && ret=0
;;
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-03-01 5:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-27 17:13 Completion after zle doesn't work Peter Stephenson
2002-03-01 5:07 ` Bart Schaefer
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).