wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.33k stars 136 forks source link

glo and ga incorrectly display terminal color codes #214

Closed phillipreeder closed 1 year ago

phillipreeder commented 1 year ago

Check list

Environment info

Problem / Steps to reproduce

Using fzf 0.30.0 and forgit 98a5cc2 displays terminal color codes instead of actually rendering the colors for the glo and ga commands. This prevents the commit from loading correctly in preview.

Screen Shot 2022-07-08 at 2 21 11 PM
wfxr commented 1 year ago

@phillipreeder Can you update forgit and try again? I cannot repro:

image
phillipreeder commented 1 year ago

Now on 492ae8 and still having issues. This is with iTerm2 and oh-my-zsh.

Screen Shot 2022-07-18 at 11 18 15 AM
wfxr commented 1 year ago

@phillipreeder Can you run the following command to see if fzf is working properly?

echo -e "\e[32mRed text\e[0m" | fzf --ansi
phillipreeder commented 1 year ago

Output of 32m and 31m

Screen Shot 2022-07-20 at 8 50 50 AM Screen Shot 2022-07-20 at 8 52 34 AM
wfxr commented 1 year ago

Weird...your fzf seems ok to render the ansi colors. Have you modified the --ansi option for fzf?

https://github.com/wfxr/forgit/blob/bd8fce74a662fd6ed90d942a797531ffd0492ae8/forgit.plugin.zsh#L416

phillipreeder commented 1 year ago
~ ❯ echo $FZF_DEFAULT_OPTS
--layout=reverse
~ ❯ echo $FORGIT_FZF_DEFAULT_OPTS
--exact --border --cycle --reverse --height '80%'
wfxr commented 1 year ago
~ ❯ echo $FORGIT_FZF_DEFAULT_OPTS
--exact --border --cycle --reverse --height '80%'

@phillipreeder $FORGIT_FZF_DEFAULT_OPTS seems to be overwritten by your custom config. You should make sure to set all the options of forgit before it is sourced.

phillipreeder commented 1 year ago

That did the trick, moving configs to before sourcing forgit solved the issue. Thanks!