joshmedeski / sesh

Smart session manager for the terminal
MIT License
410 stars 16 forks source link

sesh list -i | fzf dont show color correctly #108

Open marcellmartini opened 1 month ago

marcellmartini commented 1 month ago

What happened?

I'm using Ubuntu 22.04 update to the last version. When I ran the command sesh list -i | fzf, I expected the color and the icons to work correctly but the colors weren't interpreted correctly and the selection shows as in the image below!

image

To fix the problem, use the --ansi. Like sesh list -i | fzf --ansi.. The characters are interpreted correctly with the --ansi option.

image

I opened this bug because I didn't find this information in the documentation. it happens in fzf-tmux too and the fix is the same.

Version

Relevant log output

No response

Reviewed

joshmedeski commented 1 month ago

Thanks for the feedback. I'm in the middle of rewriting sesh to be even more performant and squash some bugs.

I will get to this but not right now, I suggest keeping the --ansi flag for now and I'll make this feature more robust during the rewrite.

marcellmartini commented 1 month ago

OK, no problem, thanks for the response. This issue will help as a temporary document for people with the same problem till it is fixed in future releases.

I added the versions of all the environments I'm using.

marcellmartini commented 1 month ago

Congratulations.. sesh is a great tool. It's helping me a lot. Keep up the great job you are doing. if you need some help with v2 I'll be happy to help in my free time.

PookieBuns commented 1 month ago

Hi! I was also facing issues with the whole tmux integration especially with Nerd Font Icon support and took a while to figure out how to tweak it all to get it working. I looked through the issue tracker and found a lot of people had similar needs and ran into similar issues as I have so I decided to write a script that would bridge the gap and simplify integrating fzf with sesh. I'm not sure if this is the correct place to post / plug this (please let me know if this isn't) but I think this could simplify the integration for many people! Once again love this tool thanks!

https://github.com/PookieBuns/fzf-sesh

joshmedeski commented 1 month ago

I wonder if the shell level had anything to do with getting the colors to render correctly 🤔

joshmedeski commented 1 month ago

Would you guys be interested in me adding an option to disable colors in the meantime? Otherwise you could keep the ansii flag or drop icons in your tooling.

PookieBuns commented 1 month ago

So I did a bit of digging and found out that this isn't even a sesh problem it's just fzf by default doesn't support ansi for performance reasons link

You can easily reproduce this by just running

echo '\033[0;36m' | fzf

with or without the ansi flag.

IMO I don't think it's that big of a deal, especially since it's not even a "bug" per se, just some incompatibility with default configurations. Probably some documentation mentioning that by default fzf doesn't support ansi color codes will suffice. Also, who doesn't like pretty colors :)

Also since sesh isn't natively integrating with fzf out of the box, I would assume this is out of scope for sesh.

joshmedeski commented 1 month ago

Thanks for the research. I don't mind upgrading how colors are handled in sesh, but these are great details to point out.

I use the --ansi flag by default because I wanted to match my terminal colors with all my fzf workflows. Maybe others want to follow a similar pattern to make it easier.