2017-12-05 22:39:10 -08:00
|
|
|
alias tmux='tmux -f "$TMUX_HOME/tmux.conf"'
|
|
|
|
|
2016-10-19 07:56:37 -07:00
|
|
|
alias ta='tmux attach'
|
|
|
|
alias tl='tmux ls'
|
|
|
|
|
2017-12-31 22:33:49 -08:00
|
|
|
if [[ -n $TMUX ]]; then # From inside tmux
|
2016-10-19 07:56:37 -07:00
|
|
|
alias tf='tmux find-window'
|
|
|
|
# Detach all other clients to this session
|
|
|
|
alias mine='tmux detach -a'
|
|
|
|
# Send command to other tmux window
|
|
|
|
tt() { tmux send-keys -t .+ C-u && tmux set-buffer "$*" && tmux paste-buffer -t .+ && tmux send-keys -t .+ Enter; }
|
|
|
|
# Create new session (from inside one)
|
|
|
|
tn() {
|
|
|
|
local name="${1:-`basename $PWD`}"
|
|
|
|
TMUX= tmux new-session -d -s "$name"
|
|
|
|
tmux switch-client -t "$name"
|
|
|
|
tmux display-message "Session #S created"
|
|
|
|
}
|
2016-11-10 09:32:57 -08:00
|
|
|
else # From outside tmux
|
2016-10-19 07:56:37 -07:00
|
|
|
# Start grouped session so I can be in two different windows in one session
|
|
|
|
tdup() { tmux new-session -t "${1:-`tmux display-message -p '#S'`}"; }
|
|
|
|
fi
|