summaryrefslogtreecommitdiff
path: root/scripts/tms
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/tms')
-rwxr-xr-xscripts/tms9
1 files changed, 6 insertions, 3 deletions
diff --git a/scripts/tms b/scripts/tms
index 97407cb..1bab0d4 100755
--- a/scripts/tms
+++ b/scripts/tms
@@ -14,9 +14,8 @@ selected_name=$(basename "$selected" | tr . _)
tmux_running=$(pgrep tmux)
if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then
- tmux new-session -s $selected_name -c $selected
+ tmux new-session -ds $selected_name -c $selected
tmux-session-setup $selected_name $selected
- exit 0
fi
if ! tmux has-session -t=$selected_name 2> /dev/null; then
@@ -24,4 +23,8 @@ if ! tmux has-session -t=$selected_name 2> /dev/null; then
tmux-session-setup $selected_name $selected
fi
-tmux switch-client -t $selected_name
+if [[ -z $TMUX ]]; then
+ tmux attach-session -t $selected_name
+else
+ tmux switch-client -t $selected_name
+fi