From 044d6336e84034c14760a2fe178f604a89626bfb Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Sat, 21 Jan 2023 21:57:51 +0100 Subject: [PATCH] make sure to use /usr/bin/infocmp to probe if tmux-256color is available system wide (2), fixes #617 some operating systems like NixOS don't have /usr/bin/infocmp --- .tmux.conf | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.tmux.conf b/.tmux.conf index 0971fef..a81f736 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -10,7 +10,6 @@ # -- general ------------------------------------------------------------------- set -g default-terminal "screen-256color" -if '/usr/bin/infocmp -x tmux-256color > /dev/null 2>&1' 'set -g default-terminal "tmux-256color"' setw -g xterm-keys on set -s escape-time 10 # faster command sequences @@ -690,6 +689,19 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # _split_window_ssh "$@" # } # +# _apply_tmux_256color() { +# # when tmux-256color is available, use it +# # on macOS though, make sure to use /usr/bin/infocmp to probe if it's availalbe system wide +# case "$uname_s" in +# *Darwin*) +# /usr/bin/infocmp -x tmux-256color > /dev/null 2>&1 && tmux set -g default-terminal 'tmux-256color' +# ;; +# *) +# command infocmp -x tmux-256color > /dev/null 2>&1 && tmux set -g default-terminal 'tmux-256color' +# ;; +# esac +# } +# # _apply_24b() { # tmux_conf_theme_24b_colour=${tmux_conf_theme_24b_colour:-auto} # tmux_conf_24b_colour=${tmux_conf_24b_colour:-$tmux_conf_theme_24b_colour} @@ -1481,6 +1493,7 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration' # ;; # esac # +# _apply_tmux_256color # _apply_24b& # _apply_theme& # _apply_bindings&