IlanCosman/tide

Separator before/after custom item is different from the one configured

gergelypolonkai opened this issue · 6 comments

Describe the bug

The separator before and after my custom item is different from the one configured.

Steps to reproduce

My function is a simple one:

function _tide_item_menv
    menv 2>/dev/null | read -l env &&
        _tide_print_item menv "" $env
end
  1. Define above function
  2. Add it to `tide_prompt_right_items
  3. As long as the menv command outputs sandbox, I get the prompt on the screenshot below

What is even stranger, if i run _tide_item_kubectl the output looks just fine:

> _tide_item_kubectl
 ⎈ do-fra1-services-cluster ⏎

But my function shows some errors:

> _tide_item_menv
test: Missing argument at index 3
= left
       ^
~/.config/fish/functions/_tide_print_item.fish (line 9): 
    else if test $_tide_side = left
            ^
in function '_tide_print_item' with arguments 'menv "" sandbox'
	called on line 3 of file ~/.config/fish/functions/_tide_item_menv.fish
in function '_tide_item_menv'
 sandbox ⏎

Screenshots

2023-10-05T09:58:22,802121843+02:00

Environment

Output of tide bug-report:

fish version: 3.6.1
tide version: 5.6.0
term: xterm-kitty
os: Fedora 39
terminal emulator: 
fish startup: 82.85 millis
fisher plugins: jorgebucaran/getopts.fish edc/bass jorgebucaran/fisher shinriyo/breeze IlanCosman/tide@v5

Additional context

Presumably the color variables for your item are not set correctly. They should both be set, and have fully uppercase color values (I should clarify this in the wiki).

tide_menv_color is CCFF00, tide_menv_bg_color is normal. That normal value is taken from the wiki but, looking at my current variables I don’t have any other color variable with that value.

Changing that value to 303030 (the value of basically all other tide_*_bg_color variables) fixed this, but using this exact value doesn’t feel right.

Changing that value to 303030 (the value of basically all other tide_*_bg_color variables) fixed this, but using this exact value doesn’t feel right.

No that is right. As you can see, your prompt items all have the same background color.

Yes they do, but

  1. where should i have taken this value other than checking the value of other variables?
  2. i took this normal value from the wiki, so I expected it to work

where should i have taken this value other than checking the value of other variables?

That was the right place.

i took this normal value from the wiki, so I expected it to work

It does work, just not the way you wanted it to 😄 (normal color is the background color of the terminal)

You are right though, the wiki does need some extra explanation of how things work. Right now it assumes more knowledge than people generally have.