désactivation tmux
parent
6b9c1f7266
commit
37157a3454
|
|
@ -65,18 +65,18 @@ alias windows='reboot_to_windows'
|
||||||
|
|
||||||
session_name="gil"
|
session_name="gil"
|
||||||
|
|
||||||
# 1. First you check if a tmux session exists with a given name.
|
## 1. First you check if a tmux session exists with a given name.
|
||||||
tmux has-session -t=$session_name 2> /dev/null
|
#tmux has-session -t=$session_name 2> /dev/null
|
||||||
|
#
|
||||||
# 2. Create the session if it doesn't exists.
|
## 2. Create the session if it doesn't exists.
|
||||||
if [[ $? -ne 0 ]]; then
|
#if [[ $? -ne 0 ]]; then
|
||||||
TMUX='' tmux new-session -d -s "$session_name"
|
# TMUX='' tmux new-session -d -s "$session_name"
|
||||||
fi
|
#fi
|
||||||
|
#
|
||||||
# 3. Attach if outside of tmux, switch if you're in tmux.
|
## 3. Attach if outside of tmux, switch if you're in tmux.
|
||||||
if [[ -z "$TMUX" ]]; then
|
#if [[ -z "$TMUX" ]]; then
|
||||||
tmux attach -t "$session_name"
|
# tmux attach -t "$session_name"
|
||||||
else
|
#else
|
||||||
tmux switch-client -t "$session_name"
|
# tmux switch-client -t "$session_name"
|
||||||
fi
|
#fi
|
||||||
|
#
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue