From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28771 invoked from network); 4 Jan 2005 21:04:06 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 4 Jan 2005 21:04:06 -0000 Received: (qmail 78036 invoked from network); 4 Jan 2005 21:04:00 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 4 Jan 2005 21:04:00 -0000 Received: (qmail 22702 invoked by alias); 4 Jan 2005 21:03:08 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8328 Received: (qmail 22688 invoked from network); 4 Jan 2005 21:03:07 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 4 Jan 2005 21:03:07 -0000 Received: (qmail 76785 invoked from network); 4 Jan 2005 21:03:07 -0000 Received: from dsl3-63-249-88-2.cruzio.com (HELO binome.blorf.net) (63.249.88.2) by a.mx.sunsite.dk with SMTP; 4 Jan 2005 21:03:03 -0000 Received: by binome.blorf.net (Postfix, from userid 1000) id 2C3AF31B1; Tue, 4 Jan 2005 13:03:02 -0800 (PST) Date: Tue, 4 Jan 2005 13:03:01 -0800 From: Wayne Davison To: Peter Stephenson Cc: zsh-users@sunsite.dk Subject: Re: how to clean a history entry? Message-ID: <20050104210301.GA17730@blorf.net> References: <200501030017.37221.toshiro@internet.com.uy> <20050104184011.E5D078636@pwstephenson.fsnet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050104184011.E5D078636@pwstephenson.fsnet.co.uk> User-Agent: Mutt/1.5.6+20040907i X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Tue, Jan 04, 2005 at 06:40:10PM +0000, Peter Stephenson wrote: > Might not be difficult to add as a feature, since internally history > is held as a linked list. I can certainly see the use in it when > you're reexecuting chunks of the history. The basic idea would be quite easy to implement, but it gets a little more complicated if the user is using an option such as SHARE_HISTORY since the history item might have already made its way into other shell instances through the shared history file. I suppose just making the current shell dump the line and then re-writing the history file to remove the line would be a good enough first implementation, though (as the user could manually deal with any propagation of the command). And, as long as I'm talking about history-related items, it would be nice to brain-storm some ideas on how to improve the recall of desirable prior commands. I tend to use HIST_IGNORE_SPACE and an absurd amount of leading-space commands to keep my history list limited to mainly just the commands that I think I will need to re-run. I also use the kill ring and Ctrl-Q to remember various commands that I need to re-run in the near term, but that I don't want to get in the way of my use of Ctrl-R to find prior well-used commands. This means that I tend to inconvenience myself by needing to take extra steps to re-run less-used commands, and that I don't use word-delete much at all. It would be nice to improve on this somehow (perhaps via options that I'm not aware of) so that the history could go back to being a list of all the (non-sensitive) commands I typed and still allow me to find my favorite commands easily. Perhaps some sort of a "bookmark" system that allows me to store off and recall my most favorite commands. Or perhaps a way to search through the history in most-used order (in addition to most-recent order) so that a recently-run rsync command doesn't get in the way of my most-used rsync commands (unless I want it to). It would be nice to have a way to specify user-selectable matching for commands that should not be stored. Perhaps even a rewriting system that could let a command be stored, but with its sensitive info XXXed out (allowing the user to re-run it by just re-inserting the missing info). And an option to expire the history list based on LRU order might be good too. Does any of that sound good? Am I missing some existing zsh features? Any other ideas for how to make command-reuse easier? ..wayne..