From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17616 invoked by alias); 16 Oct 2013 08:55:34 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31828 Received: (qmail 12248 invoked from network); 16 Oct 2013 08:55:28 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f5-b7ef66d00000795a-65-525e547d47ea Date: Wed, 16 Oct 2013 09:55:24 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Finer control over what gets written to the history file Message-id: <20131016095524.1340a535@pwslap01u.europe.root.pri> In-reply-to: <131015173453.ZM2606@torch.brasslantern.com> References: <131015094100.ZM2399@torch.brasslantern.com> <20131015175838.19f0256d@pwslap01u.europe.root.pri> <131015173453.ZM2606@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e/4Vd3akLggg+sbZC0ONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxotZS5gKujgrPs39wdzAOIm9i5GTQ0LAROLBm15mCFtM4sK9 9WxdjFwcQgJLGSU2n7/KAuEsZ5JY82ASK0gVi4CqxMKF35hAbDYBQ4mpm2YzgtgiAuISZ9ee ZwGxhQVcJc7NnAYW5xWwl3j34CnYNk4BS4kPC9+wgdhCAnMZJb6tNgCx+QX0Ja7+/cQEcYW9 xMwrZ6B6BSV+TL4HNpNZQEti87YmVghbXmLzmrfMExgFZiEpm4WkbBaSsgWMzKsYRVNLkwuK k9JzjfSKE3OLS/PS9ZLzczcxQoLw6w7GpcesDjEKcDAq8fAqxMYGCbEmlhVX5h5ilOBgVhLh TXKPCxLiTUmsrEotyo8vKs1JLT7EyMTBKdXAuLzJQy87jmvrAsazOYe7HPiKGRKkePScZX61 8/E6vvtwwjl5pq9D+enH/tN+u/xZ+fHTkXdOpZrdWodMP1Tu/lIbsPqwo0zLTJ3Og74si5e3 HNGS0Xz31ljw0euDj2KW/Pu4QF18WyH3URabt+uE5bIOMn7eKcIU3WrBWqr/Ujj1P3/FFkFf JZbijERDLeai4kQAZD9EeyACAAA= On Tue, 15 Oct 2013 17:34:53 -0700 Bart Schaefer wrote: > On Oct 15, 5:58pm, Peter Stephenson wrote: > } Subject: Re: Finer control over what gets written to the history file > > } You know about the zshaddhistory hook? Excluding by pattern is a > } fairly easy instance of this, and it should be readily extensible for > } various different ways of checking. > > Yes, but it happens at the wrong time. I don't want to prevent stuff > from going into the history as I type it, I want to filter it out of > the runtime history just before saving it. > > I.e., I want to realize 30 commands later that I really don't need the > last 30 iterations of "Src/zsh -ec '{ /bin/cp } 2>>(sleep 1; cat -n)'" > to be written to the history file. By that time zshaddhistory is long > out of the picture. We could unify the approaches and add a flag for this to histent (we've got plenty of spare bits at the moment). So e.g. zshaddhistory could return 2 to say "keep this internally but don't save it". I haven't looked, but it shouldn't be too hard to combine with the HIST_FOREIGN and HIST_TMPSTORE logic. pws