From 3838db8f7b2d1606991db04e5ee0e35a0e37fb18 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Sun, 18 Aug 2013 22:45:40 +0100 Subject: [PATCH] Fix use of pbcopy, pbpaste, and launchctl within tmux on OSX --- bin/safe-reattach-to-user-namespace | 8 ++++++++ tmux.conf | 3 +++ 2 files changed, 11 insertions(+) create mode 100755 bin/safe-reattach-to-user-namespace diff --git a/bin/safe-reattach-to-user-namespace b/bin/safe-reattach-to-user-namespace new file mode 100755 index 0000000..53abbfc --- /dev/null +++ b/bin/safe-reattach-to-user-namespace @@ -0,0 +1,8 @@ +#! /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 diff --git a/tmux.conf b/tmux.conf index b8729d9..98a786c 100644 --- a/tmux.conf +++ b/tmux.conf @@ -12,6 +12,9 @@ set -g mouse-resize-pane on set -g mouse-select-window on set -g history-limit 10240 +# Mac OS X fix for pbcopy, pbpaste, and launchctl +set-option -g default-command "safe-reattach-to-user-namespace -l $SHELL" + # Load Theme source-file "${HOME}/.tmux/themes/powerline-block-green.tmuxtheme"