Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Add IGNORE_EOF_ALWAYS option?
- X-seq: zsh-workers 29793
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Add IGNORE_EOF_ALWAYS option?
- Date: Wed, 21 Sep 2011 18:33:23 +0200
- Cc: Zsh Workers <zsh-workers@xxxxxxx>
- 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=
- In-reply-to: <110921091018.ZM16593@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CADdV=MuMPEgR7BXsaaiw7ZBf3RF0MKgtE8+pJ8gbmKhdg9XqJQ@mail.gmail.com> <110921091018.ZM16593@torch.brasslantern.com>
- Sender: nikolai.weibull@xxxxxxxxx
On Wed, Sep 21, 2011 at 18:10, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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
Wow, I am impressively stupid. Yes, it was the built-in command that
was making all the noise. Sorry about that.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author