zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Workers <zsh-workers@zsh.org>
Subject: Re: Add IGNORE_EOF_ALWAYS option?
Date: Wed, 21 Sep 2011 09:10:18 -0700	[thread overview]
Message-ID: <110921091018.ZM16593@torch.brasslantern.com> (raw)
In-Reply-To: <CADdV=MuMPEgR7BXsaaiw7ZBf3RF0MKgtE8+pJ8gbmKhdg9XqJQ@mail.gmail.com>

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


  reply	other threads:[~2011-09-21 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21  8:07 Nikolai Weibull
2011-09-21 16:10 ` Bart Schaefer [this message]
2011-09-21 16:33   ` Nikolai Weibull
2011-09-21 17:25     ` S. Cowles

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=110921091018.ZM16593@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).