zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Peter Stephenson <pws@csr.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: PATCH: exit after 10 EOF's
Date: Wed, 15 Sep 2004 08:43:37 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.61.0409150818210.20146@toltec.zanshin.com> (raw)
In-Reply-To: <200409150946.i8F9k81A008659@news01.csr.com>

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
 <Ctrl-D>

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.


  reply	other threads:[~2004-09-15 15:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-13 11:18 Peter Stephenson
2004-09-13 17:51 ` Bart Schaefer
2004-09-15  9:46   ` Peter Stephenson
2004-09-15 15:43     ` Bart Schaefer [this message]
2004-09-15 16:02       ` Bart Schaefer
2004-09-15 16:14         ` Peter Stephenson
2004-09-16 14:57           ` Peter Stephenson
2004-09-16 16:12             ` Bart Schaefer
2004-09-16 16:28               ` Peter Stephenson
2004-09-19  6:50 ` Bart Schaefer
2004-09-19  7:45   ` Duncan Sinclair
2004-09-19 16:41     ` Bart Schaefer
2004-09-19 17:52       ` Peter Stephenson
2004-09-19 18:26         ` Bart Schaefer
2004-09-19 19:25           ` Bart Schaefer
2004-09-20 10:15             ` Peter Stephenson
2004-09-20 13:59             ` Peter Stephenson
2004-09-20 14:43               ` Bart Schaefer
2004-09-20 14:53                 ` Peter Stephenson
2004-09-19 19:11         ` Bart Schaefer
2004-09-19 11:53   ` Peter Stephenson
2004-09-19 17:00     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0409150818210.20146@toltec.zanshin.com \
    --to=schaefer@brasslantern.com \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).