Commit 5583afa7 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Fix term-startup.sh when Tmux server is unreachable

parent 2088ab0c
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -14,8 +14,10 @@ declare -a OPTIONS=(
	manual="Enter command manually"
)
declare -i FOCUS=0
declare USE_TMUX=true

if [[ -v TMUX ]] || ! has tmux; then
if [[ -v TMUX ]] || ! has tmux || ! tmux has-session; then
	USE_TMUX=false
	unset OPTIONS[1]
	OPTIONS=( "${OPTIONS[@]}" )
fi
@@ -139,7 +141,9 @@ has_client() {
	return 1
}

has_client && interact

if $USE_TMUX && ! has_client; then
	# No other terms of this one's kind attached to Tmux, lets be the first
	exec tmux attach
fi

interact