From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6 invoked by alias); 3 Dec 2014 02:44:26 -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: 19478 Received: (qmail 19905 invoked from network); 3 Dec 2014 02:44:23 -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 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=IOK10brD c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=KYOhV-2-S5cu054yqv8A:9 a=CjuIK1q_8ugA:10 Resent-from: Bart Schaefer Resent-message-id: <141202184423.ZM31887@torch.brasslantern.com> Resent-date: Tue, 02 Dec 2014 18:44:23 -0800 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Resent-to: zsh-users@zsh.org From: Bart Schaefer Message-id: <141201184701.ZM30368@torch.brasslantern.com> Date: Mon, 01 Dec 2014 18:47:01 -0800 In-reply-to: <547D0369.3060802@eastlink.ca> Comments: In reply to Ray Andrews "Re: trivial problem with histverify" (Dec 1, 4:10pm) References: <547CCD76.2020806@eastlink.ca> <547D0369.3060802@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: trivial problem with histverify MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Dec 1, 4:10pm, Ray Andrews wrote: } } I'm guessing that the code that handles 'histverify' sees the " !! " } and so demands the ENTER, but I'd say that in this situation You're misinterpreting histverify. It is not intended to verify that "a history command is actually being executed." It is intended to verify that in the text of any command in which history was referenced, the correct history reference was made. For example, suppose you typed % rm -f !:4 (remove the file named by the fourth argument of the previous command). Histverify allows you to see which file name is going to be removed before it actually is removed. } shouldn't be required since no history command is actually being } executed, it's just a listing of string matches. You're giving the shell way too much credit for "knowing" what the effects of the command are going to be. You might have a command in $HOME/bin named "grep" for "gamma radiation exposure percentage" or "get rid of everyone please." } wondering if there's a workaround, so that my binding is exempt Don't use "!!" in the binding? Honestly, how did it ever get that complicated? Why print -s the words into the history and then pull them back out again with "!!" rather than just: bindkey -s '\e[5~' '\C-a history 1 | grep "[[:digit:]] \C-e"\C-m' ?? Which of course breaks if there are any double quotes in what you typed before pressing page-up, but that was already the case. } BTBTW it seems a strange way to } could find that worked at the time. This is a case where you should be writing a user-defined widget rather than using "bindkey -s". grep-history() { (( HISTNO > 1 )) || return zle -I history 1 | grep --color=auto "[[:digit:]] $BUFFER" } zle -N grep-history bindkey '\e[5~' grep-history Better?