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

[Suggestion] IGNORE_EOF like in bash



Hi there,

  I suggest that the IGNORE_EOF shell option should be implemented in the
same way as in bash. There, it is a shell variable rather than an option.
The best explanation is given in the bash manual page:

       IGNOREEOF
              Controls  the  action  of  an  interactive shell on
              receipt of an EOF character as the sole input.   If
              set,  the  value  is  the number of consecutive EOF
              characters which must be typed as the first charac­
              ters  on  an  input line before bash exits.  If the
              variable exists but does not have a numeric  value,
              or  has  no  value, the default value is 10.  If it
              does not exist, EOF signifies the end of  input  to
              the shell.

The advantage is that a user can set that variable to 3, for example, to log
out after three presses of ^D.

If you should not like to hard-code it into the shell, you should consider
the following workaround: the shell must not catch ^D on an empty command
line before any invocation of a zle widget. If ^D on an empty command is
passed to zle, too, users can write their own zle widget which ignores it,
let's say 3 times, and then logs out.

Regards,

Christoph

PS: Please send answers directly to me, since I don't subscribe the list.

-- 
"NSA GCHQ KGB CIA nuclear conspiration war weapon spy agent... Hi Echelon!"
Christoph Lange, langec@xxxxxx, http://www.cul.de/home/yaph/, ICQ #51191833



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