From f0028a21c3887754880ce00e89d37c9ef0137710 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 6 Jul 2013 19:35:32 +0900 Subject: [PATCH] add new function tx --- bashrc | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/bashrc b/bashrc index 4119cae..dab99d2 100755 --- a/bashrc +++ b/bashrc @@ -473,18 +473,30 @@ input(){ echo $foo } -tmux(){ +# tmux(){ +# if test $# -eq 0 +# then +# (cd ~; command tmux start;) +# if command tmux has -t main +# then +# command tmux attach -t main +# else +# (cd ~; command tmux new -s main;) +# fi +# else +# command tmux "$@" +# fi +# } +tx(){ if test $# -eq 0 then - (cd ~; command tmux start;) - if command tmux has -t main - then - command tmux attach -t main - else - (cd ~; command tmux new -s main;) - fi + tmux ls + echo "tx to attach." + elif tmux has -t "$1" + then + tmux attach -t "$1" else - command tmux "$@" + tmux new -s "$1" fi }