ddworken / hishtory

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

Customize colorscheme #134

Closed zhou13 closed 7 months ago

zhou13 commented 9 months ago

The default color is somewhat low-contrast with my current terminal colorscheme. It seems that the color is hard-coded. I wish I could invert the foreground color of the selected column.

Screenshot 2023-11-28 at 10 48 30 AM
ddworken commented 8 months ago

Ok, this is now supported! If you run hishtory update you'll get the latest version which includes support for configuring a custom color scheme. Check out hishtory config-get color-scheme for information on the current default color scheme, and hishtory config-set color-scheme for information on how to customize it. Please let me know what you think and if you have any other suggestions!

zhou13 commented 8 months ago

@ddworken Thank you for the work! I just tested this new feature and it seems that it is likely of buggy. On my computer, I got

$ hishtory config-get color-scheme
selected-text: #ffff99
selected-background: #3300ff
border-color: #585858

Unforunately, the hex code is wrong: my background color is #caa9fa. Since I set the color in my terminal, I don't think hishtory can get access to the hex value.

Now I execute hishtory config-set color-scheme selected-background "#663399", the background color is simply gone: image

It appears that #663399 is not a valid color. Set it back to #3300ff restore the original background color.

ddworken commented 8 months ago

Ah, thank you for this feedback! You are entirely right that this isn't working quite yet, see 30f94c1 for the details. I'll get that change officially released in the next couple days, but if you'd like to give it a shot--feel free to clone this repo and then go build; ./hishtory install to install it ahead of time. I'll let you know once this has been released!

ddworken commented 8 months ago

If you run hishtory update, you'll get the latest version with 30f94c1 included. Please let me know if this works for you!

zhou13 commented 8 months ago

After updating to the newest version, I got image

It looks nice but I don't think the hex value color of bg is quite right. #663399 should be purple like as shown below: image

Is it approximating color using 256 color or real RGB color?

ddworken commented 8 months ago

Yup, as described in the comment added in 30f94c1, it is currently approximating it with 256 colors. 77313df will add support for full terminal "TrueColor" support. Feel free to clone and build yourself if you want to try this out early, otherwise I'll let you know once it has been released. :)

ddworken commented 8 months ago

hishtory update will give you the latest version, LMK if you notice any other issues! :)

ddworken commented 7 months ago

Thanks again for all the feedback and help with this! I'm going to go ahead and mark this as closed, but please let me know if you run into any other issues!