zthxxx/jovial

Inconsistency in bold text

ejuarezg opened this issue · 10 comments

Hi,

I was trying out your zsh theme and I noticed some inconsistency in the bold text. Some of my commands had bold text and some did not. It's difficult to reproduce the bug but it's definitely there after you've used the theme for some time.

I believe I managed to track the source of the issue to the lack of %b in https://github.com/zthxxx/jovial/blob/master/jovial.zsh-theme#L139 Making this change helped solved the inconsistency in the bold text. I suspect that exit-code.suffix may also require this change.

Could you post some screenshots?

@ejuarezg I think I haven't forget to reset some style, and it's not needs %b because I have really reset all style prefixed each prompt parts, also it's prefix to the user input area;

image

image

@ejuarezg Maybe you are manually install and used it without oh-my-zsh (like the steps in docs),

actually it's a bug that sgr_reset will invalid due to not load zsh/colors module (zmodload zsh/colors),

and I fixed it in v2.2.1, would you upgrade the theme?

Yes, I did install this manually. However, I'm still able to reproduce it in the new version. See the inconsistency in the lines where I use rm and echo in the attached screenshot.
image

This is the zsh config I'm using to load and configure jovial:

setopt prompt_subst
source "$ZSH_PLUGINS_PATH/jovial/jovial.zsh-theme"
source "$ZSH_PLUGINS_PATH/jovial/jovial.plugin.zsh"
JOVIAL_SYMBOL[arrow.git-clean]='(^‿‿^)'
JOVIAL_SYMBOL[arrow.git-dirty]='(-__-)'

ZSH_PLUGINS_PATH is just a path variable pointing to my plugins location.

@ejuarezg Could you run this print commands below and take a screenshot to reply?

print -P "%B xxxx  xxxx"
print -P "%B xxxx %b xxxx"
print -P "%B xxxx ${sgr_reset} xxxx"

Additionally, note that the syntax highlight of user input area is not provide by jovial, including bold like rm README.md in your screenshot shown;
It provides by zsh-syntax-highlighting plugin most of the time, so you can disable it and try to reproduce again.

@ejuarezg Is that still able to reproduce the inconsistency bold when you disable other plugins?

Ok, I went ahead and nuked my entire zsh config and just loaded the jovial theme. Here's what it looks like after running the commands:
image

I guess this rules out your zsh theme causing the inconsistency. It may be due to zsh-syntax-highlighting or zsh-history-substring-search plugin that I use.

It is weird though that adding %b to path.suffix seems to fix the problem.

Edit: I deleted a previous post due to error where I used my jovial fork instead of your repo.

@ejuarezg Fine, thanks for use and feedback 😄 and path.suffix in JOVIAL_AFFIXES is also design for customization, so you may not need fork this repo or change source file, just set config to override in your .zshrc will be okay;

# ~/.zshrc

JOVIAL_AFFIXES[path.suffix]="%b"

see more in https://github.com/zthxxx/jovial#affixes

BTW, I have also used zsh-syntax-highlighting and zsh-autosuggestions, but cannot reproduce the bug after v2.2.1.

Interesting.. If I ever find the culprit of this bug, I'll let you know. For all I know, the cause could be some other zsh setting/option that I use in my main config. Thanks for your help!

Cheers