From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23851 invoked from network); 15 Sep 2004 15:44:56 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 15 Sep 2004 15:44:56 -0000 Received: (qmail 14279 invoked from network); 15 Sep 2004 15:44:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 15 Sep 2004 15:44:48 -0000 Received: (qmail 4527 invoked by alias); 15 Sep 2004 15:44:36 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20372 Received: (qmail 4512 invoked from network); 15 Sep 2004 15:44:36 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 15 Sep 2004 15:44:36 -0000 Received: (qmail 13648 invoked from network); 15 Sep 2004 15:43:43 -0000 Received: from moonbase.zanshin.com (64.84.47.139) by a.mx.sunsite.dk with SMTP; 15 Sep 2004 15:43:41 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.13.1/8.13.1) with ESMTP id i8FFhb96022299; Wed, 15 Sep 2004 08:43:38 -0700 Date: Wed, 15 Sep 2004 08:43:37 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-workers@sunsite.dk To: Peter Stephenson cc: zsh-workers@sunsite.dk Subject: Re: PATCH: exit after 10 EOF's In-Reply-To: <200409150946.i8F9k81A008659@news01.csr.com> Message-ID: References: <200409131118.i8DBIM5B005245@news01.csr.com> <200409150946.i8F9k81A008659@news01.csr.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_44 autolearn=no version=2.63 X-Spam-Hits: -0.0 On Wed, 15 Sep 2004, Peter Stephenson wrote: > Hmm... the documentation for ignore_eof says: > > However, ten consecutive EOFs will cause the shell to exit anyway, > to avoid the shell hanging if its tty goes away. > > Also, if this option is set and the Zsh Line Editor is used, widgets > implemented by shell functions can be bound to EOF (normally > Control-D) without printing the normal warning message. This works > only for normal widgets, not for completion widgets. > > This implies there's not even an error message, which isn't right. It implies that _widgets implemented by shell functions_ don't print an error. Which they don't -- try this: foo() { LBUFFER='Where is my error?' } zle -N foo setopt ignoreeof bindkey \^D foo The reason there's no error in that case is because of the way eofsent because of the test } else if((w = func->widget)->flags & (WIDGET_INT|WIDGET_NCOMP)) { at approximately line 904 of zle_main.c. User-defined widgets don't have such flags (see the discussion about how maybe they should, as per auto- suffix removal) so they can't possibly take that code branch. > The error message implies it *is* being treated as EOF No, it's not being treated as EOF. It's being treated as a key bound to the EOF character (and not explicitly bound to anything else). Because it is bound to the EOF character, zsh assumes the user meant to send an EOF and warns about why it didn't exit. That has nothing whatsoever to do with whether or not it exits after 10 of them. > The documentation could imply that if you bound ^D to something other > than the default, you wouldn't get the message, but there doesn't appear > to be any support for that See above. > and I don't think it's useful. I disagree. See also the heavily-commented (for a change) code in getkey() at around line 617, where it explains about zle exiting on 20 consecutive (real) EOFs.