回答:
次のif-shell
コマンドを使用します。
if-shell "uname | grep -q Darwin" "tmux-cmd1; tmux-cmd2;" "tmux-cmd3; tmux-cmd4"
OS固有のコマンドを別のファイルに入れて、「source-file」コマンドで実行することもできます。
if-shell "uname | grep -q Darwin" "source-file .tmux-macosx" "source-file .tmux-linux"
if-shell
run-shell
if-shell
run-shell
if-shell
run-shell
~/.tmux.conf
~/tmux.conf
if-shell
run-shell
if-shell
、tmux 1.8で期待どおりに動作します。私はSSHのためのセットセットのタイトル文字列にそれを使用しています:github.com/blueyed/dotfiles/commit/...
Jimeh https://github.com/jimeh/dotfiles/commit/3838db8に答えがあります。また、クリス・ジョンセンは、GitHubの問題に関する人々を支援してくれた多くの功績があります:https : //Github.com/ChrisJohnsen/tmux-MacOSX-pasteboard/issues/8#issuecomment-4134987
基本的に、safe-reattach-to-user-namespace
実際のreattach ...コマンドの存在をチェックするというシェルスクリプトを設定します。
#! /usr/bin/env bash
# If reattach-to-user-namespace is not available, just run the command.
if [ -n "$(command -v reattach-to-user-namespace)" ]; then
reattach-to-user-namespace $@
else
exec "$@"
fi