zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: accept-line question
Date: Thu, 2 Apr 2015 15:40:22 -0700	[thread overview]
Message-ID: <CAH+w=7Y_Dv4+yGM2FUG3_jE37MN6KvGoyfkTm+A6H7-J3ERNJw@mail.gmail.com> (raw)
In-Reply-To: <81DADC6E-8DFD-4FB4-9E5D-F3F4CF1EDC07@yost.com>

On Thu, Apr 2, 2015 at 2:50 PM, Dave Yost <Dave@yost.com> wrote:
> That works.
>
> I do want the executed command to be inserted into history.
>
> I searched the manual in vain for a way to do that. Any chance you could
> illuminate further?

Try this:

--- 8< ---
execute-now() {
  zle -I
  print -S "$BUFFER"
  eval "$BUFFER"
  BUFFER=
  zle -R
}
--- 8< ---

Remaining glitches will be that $? / $pipestatus won't be correct when
redrawing the prompt or executing a subsequent command.  I can't
immediately think of a workaround.


  reply	other threads:[~2015-04-02 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <FF62FDC6-BDD8-4BF3-AD44-F36E834D3B4F@yost.com>
2015-04-01 15:39 ` Bart Schaefer
     [not found] ` <E00A4521-8A4E-486C-BB2E-5D8D80639156@yost.com>
2015-04-02 20:58   ` Mikael Magnusson
2015-04-02 21:30     ` Bart Schaefer
2015-04-02 21:50   ` Dave Yost
2015-04-02 22:40     ` Bart Schaefer [this message]
2015-04-02 23:19       ` Mikael Magnusson

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='CAH+w=7Y_Dv4+yGM2FUG3_jE37MN6KvGoyfkTm+A6H7-J3ERNJw@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@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).