gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.79k stars 3.36k forks source link

NixOS does not have /usr/bin/infocmp #617

Closed maxbrunet closed 1 year ago

maxbrunet commented 1 year ago

The change made in 2cf4d9a10415f58612c1a387fbeb9c0efe79d751 breaks 256-color support on NixOS which does not have /usr/bin/infocmp:

$ command -v infocmp
/run/current-system/sw/bin/infocmp

The only available binary under /usr/bin is env to allow writing portable scripts (e.g. #!/usr/bin/env bash shebang). But reading the past issues, doing /usr/bin/env infocmp would result in a regression on MacOS where we want to ensure the system infocmp is used. Maybe the condition could call infocmp differently depending on the OS (e.g. use uname -s), or test if the executable exits and try to fallback to the one from the env if it does not?

Workaround: Add the previous command to .tmux.conf.local:

if 'infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"'
gpakosz commented 1 year ago

Hello @maxbrunet 👋

Can you please try the gh-617 branch?

maxbrunet commented 1 year ago

Hey @gpakosz :wave:, thank you for the super quick reply, gh-617 works like a charm!

gpakosz commented 1 year ago

@maxbrunet Thanks for the report!