From 096fbb065b242ce9c3de38547af0ddb9c51e92e8 Mon Sep 17 00:00:00 2001 From: Mika Suomalainen Date: Thu, 13 Oct 2011 22:40:30 +0300 Subject: [PATCH] zsh_tmux: Changed "remote" to "0". 0 is the default name of tmux session so if we start tmux and then SSH in, we probably want to attach to session 0. --- zsh_tmux | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh_tmux b/zsh_tmux index 578b0b97..196c2514 100644 --- a/zsh_tmux +++ b/zsh_tmux @@ -7,11 +7,11 @@ #fi # Starts tmux on SSH login. (From http://william.shallum.net/random-notes/automatically-start-tmux-on-ssh-login ) -# I personally think that this is more suitable for me than that which I made. TIP: replace "remote" with name of server. +# I personally think that this is more suitable for me than that which I made. TIP: replace "0" with name of computer if you don't ever have direct (physical) access to computer where zsh is running on. if [ "$PS1" != "" -a "${STARTED_TMUX:-x}" = x -a "${SSH_TTY:-x}" != x ] then STARTED_TMUX=1; export STARTED_TMUX sleep 1 - ( (tmux has-session -t remote && tmux attach-session -t remote) || (tmux new-session -s remote) ) && exit 0 + ( (tmux has-session -t 0 && tmux attach-session -t 0) || (tmux new-session -s 0) ) && exit 0 echo "tmux failed to start" fi