From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20654 invoked by alias); 16 Oct 2013 09:20:18 -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: 31829 Received: (qmail 11908 invoked from network); 16 Oct 2013 09:20:13 -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-ba-525e5a493b2a Date: Wed, 16 Oct 2013 10:20:08 +0100 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: Finer control over what gets written to the history file Message-id: <20131016102008.69640804@pwslap01u.europe.root.pri> In-reply-to: <20131016095524.1340a535@pwslap01u.europe.root.pri> References: <131015094100.ZM2399@torch.brasslantern.com> <20131015175838.19f0256d@pwslap01u.europe.root.pri> <131015173453.ZM2606@torch.brasslantern.com> <20131016095524.1340a535@pwslap01u.europe.root.pri> 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+NgFuphluLIzCtJLcpLzFFi42I5/e/4FV3PqLggg7dbZC0ONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxs1Vz1gKGngrdrV/YWpgnMzVxcjJISFgInFhxgJWCFtM4sK9 9WxdjFwcQgJLGSVW3DvEAuEsZ5KYMmU/O0gVi4CqRNvv6ywgNpuAocTUTbMZuxg5OEQEtCXa P4qBhIUFXCXOzZzGCGLzCthLNExaAWZzCjhITJ6znwnEFhK4zCjRcz4WxOYX0Je4+vcTE8QR 9hIzr5yB6hWU+DH5HtgqZgEtic3bmlghbHmJzWveMk9gFJiFpGwWkrJZSMoWMDKvYhRNLU0u KE5KzzXSK07MLS7NS9dLzs/dxAgJwa87GJceszrEKMDBqMTDqxAbGyTEmlhWXJl7iFGCg1lJ hDciOC5IiDclsbIqtSg/vqg0J7X4ECMTB6dUA2P0noZLeqviXDfw6acmfD3z0vJtUFurBvul 48yJAY9eMQSenffk6tnVB6+L3NXYUpqtdiFuqeKcHk7Ffe/u3i8+t07htiqHWLvy84B9+Yv2 q3kzL/u8WfXIvDfXxJVf7Li0XuHggRs2ZZvNztxxYdt/qzipbOem7zwcEdKpGUdVe1o5pkp5 qixWYinOSDTUYi4qTgQANWpO/h8CAAA= On Wed, 16 Oct 2013 09:55:24 +0100 Peter Stephenson wrote: > 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. Oh, wait, you're saying you didn't even realise at the time you wanted to omit the lines. You want something you can activate at the point you're about to run fc -W or exit the shell. So that would have to be a different hook, which isn't really appropriate for running on every line of a potentially huge file. So probably your way is as good as it gets. pws