From e799504a9bea9855f121769c50a6f3b7512bcb9b Mon Sep 17 00:00:00 2001 From: Gregory Pakosz Date: Mon, 15 Jul 2013 11:04:39 +0200 Subject: [PATCH] automatically use 'reattach-to-user-namespace' when available --- .tmux.conf | 4 ++++ README.md | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 78a3c22..ddf866c 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -28,6 +28,9 @@ bind e new-window -n '~/.tmux.conf' '${EDITOR:-vim} ~/.tmux.conf && tmux source # reload configuration bind r source-file ~/.tmux.conf \; display '~/.tmux.conf sourced' +# see https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard +set -g default-command "type -p reattach-to-user-namespace &>/dev/null && reattach-to-user-namespace -l $SHELL || $SHELL -l" + # -- display ------------------------------------------------------------------- @@ -118,6 +121,7 @@ bind -t vi-copy Escape cancel bind -t vi-copy H start-of-line bind -t vi-copy L end-of-line + # -- user defined -------------------------------------------------------------- source ~/.tmux.conf.local diff --git a/README.md b/README.md index fd16bb5..d39b8f0 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Features - visual theme inspired by [powerline](https://github.com/Lokaltog/powerline) - [maximize any pane to a new window with `C-+`](http://pempek.net/articles/2013/04/14/maximizing-tmux-pane-new-window/) (tmux 1.6+) - mouse mode toggle with `C-m` + - automatic usage of `reattach-to-user-namespace` if available Installation ------------ @@ -18,3 +19,14 @@ Installation $ rm -rf .tmux $ git clone https://github.com/gpakosz/.tmux.git $ ln -s .tmux/.tmux.conf + +### Accessing the Mac OSX clipboard from within tmux sessions + +[Chris Johnsen created the `reattach-to-user-namespace` +utility](https://github.com/ChrisJohnsen) that makes +`pbcopy` and `pbpaste` work again within `tmux`. + +If available, `reattach-to-user-namespace` will be automatically used by this +`tmux` configuration. You just have to install it for instance with `brew`: + + $ brew install reattach-to-user-namespsace