From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17440 invoked by alias); 24 Jan 2015 04:48:13 -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: 19778 Received: (qmail 24353 invoked from network); 24 Jan 2015 04:48:10 -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=Kc1larcG c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=YNv0rlydsVwA:10 a=e17YAVDT5gkniqoKDWwA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <150123204755.ZM2095@torch.brasslantern.com> Date: Fri, 23 Jan 2015 20:47:55 -0800 In-reply-to: Comments: In reply to Ramkumar Ramachandra "Excluding command from history list" (Jan 23, 12:32pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Excluding command from history list MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 23, 12:32pm, Ramkumar Ramachandra wrote: } } I want to exclude } *dcommit* from the history list; excluding it from the history file is } pretty simple: } } zshaddhistory () { } [[ $1 != *dcommit* ]] } } } } ... but I haven't figured out how to do it for the history list That *does* exclude it from the history list. What it doesn't do (and what nothing does) is exclude it from being kept in what might be termed the "previous command buffer". You can ALWAYS go back exactly one command, even when HISTSIZE=0, but with the zshaddhistory hook above, that command will be discarded as soon as there is another new one to replace it.