3 # ktmux: Start tmux and ktmux_helper.
4 # Usage: ktmux [options]
5 # Options: -I <path> Pass path to kinit through to ktmux_helper.
6 # -L <path> Pass path to klist through to ktmux_helper.
7 # -R <path> Pass path to krenew through to ktmux_helper.
8 # -S <path> Socket path for tmux.
9 # -T <path> Path to tmux.
10 # -n <name> Window name for new tmux session.
11 # -s <name> Session name for new tmux session.
12 # -t <name> Target session name for new tmux session.
19 while getopts ":I:L:R:S:T:n:s:t:" opt; do
21 I|L|R) helper_opts="$helper_opts -$opt $OPTARG";;
22 T) tmux="$OPTARG"; helper_opts="$helper_opts -$opt $OPTARG";;
23 n|s|t) session_opts="$session_opts -$opt $OPTARG";;
24 S) tmux_opts="$tmux_opts -$opt $OPTARG";;
29 if [ -z "$KRB5CCNAME" ]; then
30 krb5ccname="$KRB5CCNAME"
31 [ -z "$krb5ccname" ] && krb5ccname=FILE:${TMPDIR:-/tmp}/krb5cc_${UID}_ktmux_$$
32 export KRB5CCNAME="$krb5ccname"
36 exec $tmux ${tmux_opts## } new-session ${session_opts## } -d ';' set-environment KRB5CCNAME "$KRB5CCNAME" ';' attach ';' run-shell "ktmux_helper ${helper_opts## }"