Add support for iTerm2's Tmux integration

This should resolve #52.
This commit is contained in:
2014-12-01 21:01:58 +00:00
parent 6f98020309
commit 41da75ad39
3 changed files with 23 additions and 2 deletions

View File

@@ -202,6 +202,22 @@ any reason you need to disable it, just set `$TMUXIFIER_NO_COMPLETE`.
export TMUXIFIER_NO_COMPLETE=1
```
## Tips
### iTerm2 Integration
Tmuxifier supports iTerm2's [Tmux integration][]. It can be used in two ways:
- Passing `-CC` as a second argument to the `load-session` command. For
example:
tmuxifier load-session my-awesome-session -CC
- Setting the `TMUXIFIER_TMUX_ITERM_ATTACH` environment variable to `-CC`
before calling the `load-session` command.
[tmux integration]: https://code.google.com/p/iterm2/wiki/TmuxIntegration
## Inspiration
- Tmuxifier is largely inspired by [Tmuxinator][].

View File

@@ -323,7 +323,8 @@ __get_current_window_index() {
__go_to_session() {
if [ -z "$TMUX" ]; then
tmuxifier-tmux -u attach-session -t "$session:"
tmuxifier-tmux $TMUXIFIER_TMUX_ITERM_ATTACH -u \
attach-session -t "$session:"
else
tmuxifier-tmux -u switch-client -t "$session:"
fi

View File

@@ -7,7 +7,7 @@ source "$TMUXIFIER/lib/util.sh"
# Provide tmuxifier help
if calling-help "$@"; then
echo "usage: tmuxifier load-session <layout_name | file_path>
echo "usage: tmuxifier load-session <layout_name | file_path> [<iterm mode>]
Aliases: session, ses, s
@@ -30,5 +30,9 @@ fi
# Load runtime functions.
source "$TMUXIFIER/lib/runtime.sh"
if [ "$2" == "-CC" ]; then
export TMUXIFIER_TMUX_ITERM_ATTACH="-CC"
fi
# Load session file.
load_session "$1"