ddworken / hishtory

Your shell history: synced, queryable, and in context
https://hishtory.dev
MIT License
2.48k stars 45 forks source link

Support customizing the column names #60

Open ddworken opened 1 year ago

ddworken commented 1 year ago

As originally suggested in #59

GRbit commented 2 months ago

I think I can give it a go.

I have two ideas:

  1. change displayed_columns in config from array of strings, to a dictionary "original_column_name": "custom_column_name". I think I can code it to read strings and change it after.
  2. Add new dict renamed_columns with the same structure of "original_name": "custom_name"

Advantages of the second approach is that you have better backward compatibility, but it could be tricky with sorting. If you want your own order, you'll have to set all columns as renamed ones. Like if there will be something in both displayed_columns and renamed_columns we will have to insert all displayed first and all renamed after. So if users would like to rename just one column, they'll have to overwrite all the columns as renamed, which isn't very convenient.

Tell me what you think please, and feel free to add more info about what you'd like to see in this feature.