ddworken / hishtory

Your shell history: synced, queryable, and in context

Home Page:https://hishtory.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot delete last custom-column

willemml opened this issue · comments

If I add a custom column to my hishtory config via hishtory config-add custom-columns $NAME $COMMAND and then try to delete it the command fails like so:

$ hishtory config-add custom-columns example 'echo Hello!'

$ hishtory config-get custom-columns
example:   echo Hello!

$ hishtory config-delete custom-columns example
2023/11/11 21:28:19 Did not find a column with name "example" to delete (current columns = []hctx.CustomColumnDefinition{hctx.CustomColumnDefinition{ColumnName:"example", ColumnCommand:"echo Hello!"}})

If I add more than one custom column I can delete all but the last one. It does not matter what order they are added, it is always impossible for me to remove the last entry. I have test this with multiple entry key value combinations.

My config (with keys redacted) with an non-removeable entry:

{"user_secret":"0000","is_enabled":true,"device_id":"0000","last_saved_history_line":"","have_missed_uploads":false,"missed_upload_timestamp":0,"have_completed_initial_import":true,"enable_control_r_search":true,"displayed_columns":["Hostname","CWD","Timestamp","Runtime","Exit","Code","Command"],"custom_columns":[{"column_name":"example","column_command":"echo Hello!"}],"is_offline":false,"filter_duplicate_commands":false,"timestamp_format":"Jan 2 2006 15:04:05 MST","beta_mode":false}

Thank you for the detailed bug report! 68142bf fixes this and I'll get it released (so that hishtory update will pick up the change) as soon as Github Actions finishes running all the integration tests.

This has now been released! If you run hishtory update this should work properly. If you run into any other issues, please let me know. :)

Awesome! Thanks for the quick fix!