romkatv / gitstatus

Git status for Bash and Zsh prompt
GNU General Public License v3.0
1.68k stars 106 forks source link

Add support for 256 terminal colors #406

Closed mortezadadgar closed 1 year ago

mortezadadgar commented 1 year ago

Hey, Currently gitstatus uses custom colors which might be not the one the users are using in their terminal: image for example untracked foreground is not what i use in my terminal as you can use it differ from path color in any case it's better to use terminal colors as they represents colors used by users instead of hardcoding it in source code

romkatv commented 1 year ago

I don't understand the problem or the suggested solution.

mortezadadgar commented 1 year ago

OK let me try one more time: for example this is where you hardcoded color for untracked: https://github.com/romkatv/gitstatus/blob/38d35b95926e09d07b8cf78edade7cee7a9a1dcf/gitstatus.prompt.zsh#L39 I don't understand the syntax but to me it looks like a color code this seems to the color used by terminal https://github.com/romkatv/gitstatus/blob/38d35b95926e09d07b8cf78edade7cee7a9a1dcf/gitstatus.prompt.sh#L38 so no matter what color I have configured in my terminal color it will be that

to me gitstatus uses 8-bit colors for zsh and 256 colors for other shell

romkatv commented 1 year ago

Your screenshot isn't using this code.

romkatv commented 1 year ago

Can you describe what you do, what you expect and what you observe?

mortezadadgar commented 1 year ago

I expect 256 colors to be used for zsh

mortezadadgar commented 1 year ago

Your screenshot isn't using this code.

I sourced ~/git/gitstatus/gitstatus.prompt.zsh

mortezadadgar commented 1 year ago

sorry I meant base16 colors not 256...

romkatv commented 1 year ago

See docs starting from here: https://github.com/romkatv/gitstatus/blob/38d35b95926e09d07b8cf78edade7cee7a9a1dcf/README.md?plain=1#L93

Alternatively, use powerlevel10k.

mortezadadgar commented 1 year ago

yeah good to know it can be configured but I think having base16 terminal colors being used as default is closer to what users are using in their terminals yeah I can change them to base16 I guess but why would be there predifined colors is source if everybody is going to change them anyway? I'm just suggesting to use sane-defaults colors

romkatv commented 1 year ago

Changing the default colors will change the prompt of existing users. That's a no go.

Besides, it's questionable whether the lower 16 colors are preferred. Powerlevel10k has a choice and the vast majority of users selects high-numbered colors.