From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24128 invoked by alias); 21 Sep 2011 16:10:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 29792 Received: (qmail 29314 invoked from network); 21 Sep 2011 16:10:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110921091018.ZM16593@torch.brasslantern.com> Date: Wed, 21 Sep 2011 09:10:18 -0700 In-reply-to: Comments: In reply to Nikolai Weibull "Add IGNORE_EOF_ALWAYS option?" (Sep 21, 10:07am) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Workers Subject: Re: Add IGNORE_EOF_ALWAYS option? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 21, 10:07am, Nikolai Weibull wrote: } } bindkey -a '^D' zle/foreground-or-exit } } zsh: use 'exit' to exit. } } when I press ^D when the following conditions hold (Src/Zle/zle_main.c:1290): } } 1. ^D is bound to a user-defined command } 2. The command line is empty } 3. No arguments have been given (unclear exactly what this actually means) } 4. IGNORE_EOF has been set } } The problem is that I don't want this behavior. If you are correct, then (1) would be a bug. The comment in zle_main.c explicitly says The rule is that "zle -N" widgets suppress EOF warnings. And the doc says 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. So the behavior you want is the one you are supposed to get; we should not need another option. However, I can't make a simple case that reproduces your error. Have you defined zle/foreground-or-exit with zle -C rather than zle -N ? Or perhaps the problem is not where you think it is? } 3. Exiting insert mode in Zle (running in vi mode) % bindkey -v % bindkey '^D' vi-cmd-mode % ^D zsh: use 'exit' to exit. You can easily fix that like this: silent-vi-cmd-mode() { zle vi-cmd-mode } zle -N silent-vi-cmd-mode bindkey -v bindkey ^D silent-vi-cmd-mode