tmux sessionizer fixed and other minor things
This commit is contained in:
parent
3852948adf
commit
7d2e441211
6 changed files with 22 additions and 14 deletions
|
@ -16,17 +16,15 @@ tmux_running=$(pgrep tmux)
|
|||
|
||||
|
||||
if [[ -z "$tmux_running" ]]; then
|
||||
if [[ -z $TMUX ]]; then
|
||||
tmux new-session -s "$selected_name" -c "$selected"
|
||||
exit 0
|
||||
fi
|
||||
tmux new-session -s "$selected_name" -c "$selected"
|
||||
else
|
||||
if [[ -z $TMUX ]]; then
|
||||
tmux a
|
||||
fi
|
||||
if ! tmux has-session -t="$selected_name" 2> /dev/null; then
|
||||
tmux new-session -ds "$selected_name" -c "$selected"
|
||||
fi
|
||||
tmux switch-client -t "$selected_name"
|
||||
if [[ -z $TMUX ]]; then
|
||||
tmux attach -t "$selected_name"
|
||||
else
|
||||
tmux switch-client -t "$selected_name"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue