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

Re: PATCH: exit after 10 EOF's



Bart Schaefer wrote:
> On Mon, 13 Sep 2004, Peter Stephenson wrote:
> 
> > The shell is supposed to exit after 10 EOFs if ignore_eof is set.
> > When zle is in use this appears to have been broken for a long time.
> 
> Actually I think that was intentional.  ZLE is able to distinguish a real
> end-of-file from a press of the EOF key, so it doesn't need the failsafe
> to prevent it from going into an infinite loop when the SHIN descriptor
> is closed.

You mean, because canonical input is turned off.

> In other words, the shell is supposed to exit after 10 real end-of-files,
> not after 10 keyboard-initiated end-of-files.
> 
> Unless I've missed or forgotten something ...

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.  The
error message implies it *is* being treated as EOF, which is what really
made me change it.  I would suggest either followng the documentation or
the standard 10-character practice.

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, and I don't think it's useful.

-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************



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