dotfiles/.bash_rc.d/10.tmux.sh

22 lines
372 B
Bash

#!/bin/bash
#
# Copyright 2012 Google Inc. All Rights Reserved.
# Author: jwall@google.com (Jeremy Wall)
tmux_session() {
sess=$1;
shift;
echo $*
tmux has-session -t $sess && \
tmux attach-session -t $sess || tmux new-session -s $sess $*
}
tmux_remote() {
host=$1
shift;
sess=$1;
shift;
echo $*
ssh $host -t tmux_session $sess "$*"
}