hastory icon indicating copy to clipboard operation
hastory copied to clipboard

Incorrect 'd'-keys in log lines

Open ndcroos opened this issue 6 years ago • 4 comments

The values of 'd'-keys in the log lines are 'shifted' by one. Let me illustrate this with an example.

Suppose the following commands are executed:

cmd n at date n cmd n+1 at date n+1

Then cmd n-1 gets logged with date n, cmd n gets logged with date n+1 and so on.

entryDateTime's value corresponds to the local zone time 'now' (https://github.com/NorfairKing/hastory/blob/development/hastory-data/src/Data/Hastory/Gather.hs#L19) , instead of when the command was executed.

One way to solve this issue is to echo the time of execution, so it gets piped into 'hastory gather'.

ndcroos avatar Jul 07 '18 09:07 ndcroos

I think https://github.com/NorfairKing/hastory/pull/4 will already solve this problem by gathering the command when it's executed instead of afterward.

NorfairKing avatar Jul 15 '18 17:07 NorfairKing

#4 will solve the problem in this issue for zsh, but not for bash.

ndcroos avatar Jul 16 '18 14:07 ndcroos

Why is that? I don't see it.

NorfairKing avatar Jul 16 '18 14:07 NorfairKing

At this moment, I don't see it either, what the reason of this behaviour is. It is just what I observed by trying both bash and zsh. EDIT: I used Xfce Terminal on Manjaro for the manual 'bash' test.

ndcroos avatar Jul 16 '18 14:07 ndcroos