Adjusted tmux sections

This commit is contained in:
2Shirt 2019-11-18 19:40:16 -07:00
parent 5d5da09c0d
commit 364f981a58
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C
2 changed files with 5 additions and 0 deletions

View file

@ -143,6 +143,8 @@ def tmux_split_window(
def tmux_switch_client(target_session=None):
"""Switch to target tmux session, or previous if none specified."""
# DEPRECATED - Do nothing
return
cmd = ['tmux', 'switch-client']
if target_session:
cmd.extend(['-t', target_session])

View file

@ -32,6 +32,9 @@ function launch_in_tmux() {
if [[ -n "${TMUX:-}" ]]; then
# Running inside TMUX, switch to session
tmux switch-client -t "$SESSION_NAME"
if ! jobs %% >/dev/null 2>&1; then
exit 0
fi
else
# Running outside TMUX, attach to session
tmux attach-session -t "$SESSION_NAME"