From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13997 invoked by alias); 21 Sep 2011 16:33:34 -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: 29793 Received: (qmail 13033 invoked from network); 21 Sep 2011 16:33:31 -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=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.171 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/sHw4MnVF3AA3by+CvRB2Sd+p9SrADpjGeiGFVRBlm0=; b=yAtSVqzfr71ggHVtDOHAgLuQCv1jRi10r64u+X2QA5IT9PA+pGeNswam/q57aGPf8L Yo+U+jOX4GRNnX87qVdSYsffFoxOraLc55njyRCEP+RRQN4H+qEPk0MFJI4dRkB8Dgwd 4Iqhq2mqLag/eDTJ8O86B7TDM5/zLDkHu91R4= MIME-Version: 1.0 Sender: nikolai.weibull@gmail.com In-Reply-To: <110921091018.ZM16593@torch.brasslantern.com> References: <110921091018.ZM16593@torch.brasslantern.com> Date: Wed, 21 Sep 2011 18:33:23 +0200 X-Google-Sender-Auth: cQc9-g_quDjotamu0Vtym-6UO6I Message-ID: Subject: Re: Add IGNORE_EOF_ALWAYS option? From: Nikolai Weibull To: Bart Schaefer Cc: Zsh Workers Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Sep 21, 2011 at 18:10, Bart Schaefer wr= ote: > 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 mea= ns) > } 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. =C2=A0The comment in zle_mai= n.c > explicitly says > > =C2=A0 =C2=A0 The rule is that "zle -N" widgets suppress EOF warnings. > > And the doc says > > =C2=A0 =C2=A0 Also, if this option is set and the Zsh Line Editor is used= , > =C2=A0 =C2=A0 widgets implemented by shell functions can be bound to EOF > =C2=A0 =C2=A0 (normally Control-D) without printing the normal warning me= ssage. > =C2=A0 =C2=A0 This works only for normal widgets, not for completion widg= ets. > > 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. =C2=A0Hav= e > 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 Wow, I am impressively stupid. Yes, it was the built-in command that was making all the noise. Sorry about that.