From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27652 invoked by alias); 4 Nov 2013 18:14:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 18090 Received: (qmail 8024 invoked from network); 4 Nov 2013 18:14:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) 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.2 From: Bart Schaefer Message-id: <131104101408.ZM17080@torch.brasslantern.com> Date: Mon, 04 Nov 2013 10:14:08 -0800 In-reply-to: Comments: In reply to Thiago Padilha "Re: How to restart zle without invoking 'accept-line'?" (Nov 3, 7:53pm) References: <131030083139.ZM8019@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh-Users List Subject: Re: How to restart zle without invoking 'accept-line'? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Nov 3, 7:53pm, Thiago Padilha wrote: } } I've tried to use the passthrough example from the keymap+widget tip you } gave on the other thread: } [...] } } This works when I press enter(accept-line) but for ctrl+c I still need to } press two times to restart zle. I'm sorry, I hadn't fully comprehended that you were setting up to jump directly into this from zle-line-init. You can't actually restart zle from zle-line-init because, technically, zle hasn't started *yet* at that point. Send-break will interrupt whatever zle-line-init is doing, but then you just fall on through to the "instance" of zle that was already starting. } If I bind 'recursive-edit-and-accept to a key and activate it outside } zle-line-init, everything works as expected. That is a clue to how you might make this work: (1) bind recursive-edit-and-accept to a key string (2) in zle-line-init, use "zle -U" to put that string on the input This way, when zle-line-init ends, the first thing that will be run by the editor is the command to switch to recursive-edit-and-accept. By the way, you don't need to put the "zle -N ... end-recursive-edit" inside the function body of recursive-edit-and-accept. The zle -N may be done just once, and keymap+widget will take care of the rest.