From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22399 invoked by alias); 1 Dec 2014 23:26:46 -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: 19475 Received: (qmail 1930 invoked from network); 1 Dec 2014 23:26:44 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/eW5lvuwpxo6cWc+10HhI/8n4HFZsq1aDazbwuOUKTo=; b=OcfPuvpWgJq0SkFZnuii9xYCgHJUrKt/uo841BQ5ys8dQW+2kKbseDpqH62bQA2iFh I5C5W2DrSiS3Qj+NaDkfo7S7u6Vo6b9qgMFj4u2u8FXrDKhsh2OuI9DbRNNR9w6/swyr qiBe4P7hXaKYZ/go9ugqINhwasIflNLGP4AcjNagPlzrmwFCFt9YAm2WB2zjVwWT61zu V1aF0BOCrR+JCj0uQ/lQoozMGtKzYfXQvcUp1OuvGCYjbDGu+mgn8SOeBtM+PuW+mRlb zMnIm9s1Sp9QZ/KIKMiTPG2nAtLKHHou8KL5/Zyk/tcdgMlhPBMlZTovDOnPBuiJnSQk xtRQ== MIME-Version: 1.0 X-Received: by 10.42.25.144 with SMTP id a16mr309819icc.66.1417476399066; Mon, 01 Dec 2014 15:26:39 -0800 (PST) In-Reply-To: <547CCD76.2020806@eastlink.ca> References: <547CCD76.2020806@eastlink.ca> Date: Tue, 2 Dec 2014 00:26:39 +0100 Message-ID: Subject: Re: trivial problem with histverify From: Mikael Magnusson To: Ray Andrews Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On Mon, Dec 1, 2014 at 9:20 PM, Ray Andrews wrote: > I have this command bound to PgUp: > > history 1 | grep --color=auto "[[:digit:]] !!" > > ... it does the obvious thing, I type a string I want to search for in > history and get > a nice colored listing. When recalling a command from history with '!', I > like to > have 'setopt histverify' in case I want to edit the command, or just be sure > I'm > going to execute the correct command before it fires. However, if that > option is > set, it fouls up the above keybinding in the predictable way, it demands > ENTER > before it will work. It seems on the face of it that 'histverify' is not > being very > smart about that, because the key binding isn't executing a command, it's > just making a listing. It seems as if the test for 'histverify' is just > seeing the > literal bangs in the key binding and not figuring out that there is really > no command > being executed. Is this really what we want? If so, is there a simple > work-around? > As it is, I just leave 'histverify' off, and try to be careful, so it's > hardly important, > but I would like to have it both ways if possible. If histverify is set or not doesn't change the fact that !! in your command will expand as normal. If you want to suppress history expansion you either have to disable the banghist option, or quote the history character (!). Long story short is: '[[:digit:]] !!' will do what you want (double quotes do not stop history expansion). -- Mikael Magnusson