From c76ce101b83ca859ad4cb1340b710d761eb0c63d Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 12 Jun 2022 14:23:52 -0700 Subject: [PATCH] Teach isolated-tmux to use screen-256color TERM on Mac Mac does not ship tmux-256color terminfo, so teach our isolated-tmux function to populate .tmux.conf with screen-256color instead, only on macOS. --- tests/test_functions/isolated-tmux-start.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_functions/isolated-tmux-start.fish b/tests/test_functions/isolated-tmux-start.fish index 1355f397c..732ab26dd 100644 --- a/tests/test_functions/isolated-tmux-start.fish +++ b/tests/test_functions/isolated-tmux-start.fish @@ -2,6 +2,11 @@ function isolated-tmux-start set -l tmpdir (mktemp -d) cd $tmpdir + # macOS lacks the tmux-256color terminfo, use screen-256color instead. + if test (uname) = Darwin + echo 'set -g default-terminal "screen-256color"' + end >./.tmux.conf + function isolated-tmux --inherit-variable tmpdir # tmux can't handle session sockets in paths that are too long, and macOS has a very long # $TMPDIR, so use a relative path - except macOS doesn't have `realpath --relative-to`... @@ -11,7 +16,7 @@ function isolated-tmux-start echo "error: isolated-tmux must always be run from the same directory." >&2 return 1 end - tmux -S .tmux-socket -f /dev/null $argv + tmux -S .tmux-socket -f .tmux.conf $argv end function isolated-tmux-cleanup --on-event fish_exit --inherit-variable tmpdir