From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9164 invoked from network); 21 Nov 2001 22:23:29 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 21 Nov 2001 22:23:29 -0000 Received: (qmail 16921 invoked by alias); 21 Nov 2001 22:23:20 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 16272 Received: (qmail 16908 invoked from network); 21 Nov 2001 22:23:19 -0000 Date: Wed, 21 Nov 2001 14:21:33 -0800 (PST) From: Wayne Davison X-Sender: wayne@life.blorf.net To: Danek Duvall Cc: Zsh hackers list Subject: Re: history editing In-Reply-To: <20011116100106.A944@lorien.emufarm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 16 Nov 2001, Danek Duvall wrote: > My normal course is to delete the last few lines of the history. And > while they disappear from the end of the history, they reappear at the > beginning. Re-running the function -- where those lines don't appear in > the editor at all -- makes them disappear entirely. This seems like the proper thing for your cited function to do. I'm assuming you have SAVEHIST and HISTSIZE set to the same value, right? To see how this works, assume that this value is 100. You edit the file down to 97 lines by removing the last 3 lines and then load the history file. This pushes the 97 lines onto the history, and the first 3 still remain up at the top. If you repeat the sequence, they get pushed off into oblivion by the re-reading of the same 97 lines. So, there's nothing wrong with how your function works that I can see. You could change it to discard the old history if you wanted to, though: edh() { local histfile histsize histfile=${HISTFILE:-$HOME/.zshist} histsize=$HISTSIZE fc -AI $histfile vi + $histfile HISTSIZE=0 HISTSIZE=$histsize fc -R $histfile } ..wayne..