Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hishtory export-json provide wierd output #280

Closed
jmauro opened this issue Jan 7, 2025 · 1 comment
Closed

Hishtory export-json provide wierd output #280

jmauro opened this issue Jan 7, 2025 · 1 comment

Comments

@jmauro
Copy link

jmauro commented Jan 7, 2025

Hello,

I am using the export to JSON feature (Which is great BTW) but I can see weird output and I don't know to understand it, let me show you:

$ # hishtory export-json | grep "#1"
{"command":"#1730977871","current_working_directory":"Unknown","custom_columns":null,"end_time":"2025-01-07T01:22:41.370339162Z","exit_code":0,"home_directory":"/root","hostname":"da06a72ec857","local_username":"root","start_time":"2025-01-07T01:22:41.369339162Z"}
...

And I can find 260 lines with this pattern, and I don't have any clue why.

Kind regards,
JM
@ddworken
Copy link
Owner

Thanks for reporting this! There is some weirdness that I have found with bash history files where it contains entries like this that show up when importing the existing history. It seems like the regex I had wasn't quite permissive enough, so I updated it in #283 to make sure we don't import entries like this in the future.

I'm hesitant to automatically delete existing entries, but this will make sure this doesn't happen for future entries. If you'd like to manually delete these, you can use hishtory redact to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants