Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [4.0.2 bug] commands not written to history

On 12 Jul, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

> Hrm.  Just because there's an entry in $HISTFILE doesn't mean that it's
> present in the shell history, of course.  With INC_APPEND_HISTORY set
> (as I believe you have), $HISTFILE may have up to $[SAVEHIST/5] extra
> commands stored in it.  (This is to avoid having to rewrite the entire
> file too frequently.)  But only $HISTSIZE of those commands is actually
> in memory (and thus searchable) at any given time.

But this wasn't the problem, as the history contained about 100 lines
(it was just after I used a new history file), and $HISTSIZE is 2000

> Next time you see this happen, try running `fc -W temphistfile' and then
> `diff $HISTFILE temphistfile'.  You should see differences only at the
> beginning and possibly one or two commands at the end, not in the middle.
> If there are commands missing (or misordered) in the middle, then we'll
> have evidence of a real bug.

greux:~[Failed 130]> fc -W temphistfile                               <14:30:51
greux:~> diff $HISTFILE temphistfile                                  <14:35:11
< : 994936533:0;mail
> : 994937129:867;mail
< : 994939941:0;m $HISTFILE
< : 994939999:0;mail
< : 994940004:0;m $HISTFILE
< : 994940081:0;mail
< : 994940743:0;rem
> : 994939966:13;m $HISTFILE
> : 994939999:2;mail
> : 994940004:8;m $HISTFILE
> : 994940743:308;rem
< : 994941319:0;diff $HISTFILE temphistfile

Is it normal?

It seems that a "mail" command has disappeared from the history file.

> } It seems to be due to the fact that the time stamps are not in the
> } increasing order.

> Can you show an example of this, please?

This can be done by manually copying commands to the history file
(useful when starting with a new history file...). But even without
doing that:

: 994850317:0;emacs cshrc.loria
: 994850342:0;rl lepois
: 994850341:0;locale

But this is because host lepois wasn't synchronized, so a very special

Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/> - 100%
validated HTML - Acorn Risc PC, Yellow Pig 17, Championnat International des
Jeux Mathématiques et Logiques, TETRHEX, etc.
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

Messages sorted by: Reverse Date, Date, Thread, Author