From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1471 invoked from network); 7 Aug 2001 19:47:34 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Aug 2001 19:47:34 -0000 Received: (qmail 27101 invoked by alias); 7 Aug 2001 19:47:09 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4092 Received: (qmail 27079 invoked from network); 7 Aug 2001 19:47:06 -0000 Date: Tue, 7 Aug 2001 12:46:34 -0700 (PDT) From: Wayne Davison X-X-Sender: To: Vincent Lefevre Cc: Subject: Re: [4.0.2 bug] commands not written to history In-Reply-To: <4a9256987fvincent@vinc17.org> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463796991-1988342638-997213594=:3311" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. ---1463796991-1988342638-997213594=:3311 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 29 Jun 2001, Vincent Lefevre wrote: > It seems that cmd2 simply disappeared from the history; cmd2 probably > was the last command I typed in the shell, then I logged out, and > logged in again (thus, the xinit in the history just after cmd1). I was finally able to reproduce a case where the shell failed to save the very last command in the history. It only occurs when the Zle history is active and the shell gets a signal that causes it to die. In these circumstances, the save-history code is subtracting 1 from the maximum number of events that it will save (so that the last, unfinished line is not written out), but since the code is really rewriting the history file using an alternate history buffer, the real result is that it loses the last line in the just-read data. So, do you know if you were exiting the shell via some kind of signal rather than typing something like "exit"? If so, try the attached patch and see if this fixes the problem. ..wayne.. ---1463796991-1988342638-997213594=:3311 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="hist.patch" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: fix last-line lossage Content-Disposition: attachment; filename="hist.patch" SW5kZXg6IFNyYy9oaXN0LmMNCi0tLSBTcmMvaGlzdC5jCTIwMDEvMDYv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