Commit 378c1929 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Fallback to shell if Tmux cannot start due to term issues

parent 1e9cbe7d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -94,6 +94,15 @@ service_installed() {
start_client() {
	[ $# -eq 1 ] || bad_arg "start-client takes no arguments"
	[ -z "$TMUX" ] || die "this command must be run from outside of tmux"
	tput clear ||
	case $? in
		# exit code 1 means tmux-client cannot support this term type
		1)
			warn "Not starting Tmux due to an unsupported or unrecognised term type"
			exec env TMUX=skip ${CURRENT_SHELL-$SHELL} -l
			;;
		*) return 1 ;;
	esac
	if ! tmux has-session; then
		if has systemctl && service_installed; then
			$SERVICE_CTL start $SERVICE_UNIT