3 ms·
If I'm understanding it correctly, what this sort of approach will give you is a timestamp in the prompt which is generated when the prompt is printed to the te
by countermeasure 6y ago
If I'm understanding it correctly, what this sort of approach will give you is a timestamp in the prompt which is generated when the prompt is printed to the terminal and then doesn't change.
The thing is that the prompt might sit there for minutes or hours before you use it to run a command, so that timestamp doesn't reliably serve as an accurate record of when a command was run.
That's the problem which my approach addresses by updating the timestamp when a command is run.
- Bnshsysjab 6y agoSure, forensics accuracy isn’t something I hugely care about, i do have some shell sessions that span days so having an indication can be handy. If I did, It’s also possible to get amount of time a command required to complete. Based on that execution time in conjunction with the timestamp of the next print of PS1 it would be easy to deduce the time when a line was actually executed, rather than when typing of the line began, but at that point I’d probably just record my screen to track any harder to determine behaviours.