From 318c2c46ea14af9b7a48eb97543240c284badee4 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Wed, 28 Mar 2018 15:21:16 +0200 Subject: [PATCH] [tmux] fix immediate exit on Linux The fix in commit 6bd38b874978e96dc2632abf1c98460e908fa6a6 causes tmux to exit immediately when running on Linux, since the reattach-to-user-namespace is specific to MacOS and the binary is therefore not available on Linux. More details at: http://www.economyofeffort.com/2013/07/29/reattach-to-user-namespace-the-fix-for-your-tmux-in-os-x-woes/ --- tmux-macos.conf | 5 +++++ tmux.conf | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tmux-macos.conf diff --git a/tmux-macos.conf b/tmux-macos.conf new file mode 100644 index 0000000..206a649 --- /dev/null +++ b/tmux-macos.conf @@ -0,0 +1,5 @@ +# Fix for clipboard in vim running inside tmux: +# See http://stackoverflow.com/a/40154047 +# See https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard +set -g default-command "reattach-to-user-namespace -l $SHELL" + diff --git a/tmux.conf b/tmux.conf index 774ecda..a7e7872 100644 --- a/tmux.conf +++ b/tmux.conf @@ -24,7 +24,6 @@ bind -r C-j resize-pane -D 5 bind -r C-k resize-pane -U 5 bind -r C-l resize-pane -R 5 - # # General # @@ -61,3 +60,7 @@ setw -g window-status-current-bg default set -g pane-border-fg colour0 # Base02 set -g pane-active-border-fg colour9 # Orange +# Apply platform specific configurations: +# See http://www.economyofeffort.com/2013/07/29/reattach-to-user-namespace-the-fix-for-your-tmux-in-os-x-woes/ +if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux-macos.conf' +