hastory
hastory copied to clipboard
Incorrect 'd'-keys in log lines
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'.
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.
#4 will solve the problem in this issue for zsh, but not for bash.
Why is that? I don't see it.
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.