TermHub

Is your host phone-ready?

Before you rely on TermHub from your phone, run one quick check on the host itself. It catches the two things that quietly break a mobile setup: a multiplexer your phone can't see, and a machine that falls asleep.

Run this on your host

Copy the script and run it on the machine you connect to, your Mac or server, not the phone. It prints an OK, WARN, or FAIL for each thing TermHub needs, and only reads your settings; nothing is uploaded or changed.

#!/usr/bin/env bash
# TermHub host check, runs entirely on your machine. Nothing is uploaded.
# Review it, then run on your host:   bash host-check.sh
set -u
ok(){   echo "  OK    $1  $2"; }
warn(){ echo "  WARN  $1  $2"; }
fail(){ echo "  FAIL  $1  $2"; }

echo "TermHub host check"
os=$(uname -s)

# SSHD, can TermHub reach an SSH server here at all?
if [ "$os" = Darwin ]; then
  systemsetup -getremotelogin 2>/dev/null | grep -qi on \
    && ok   "SSHD " "Remote Login is on" \
    || warn "SSHD " "turn on Remote Login (System Settings > General > Sharing)"
else
  pgrep -x sshd >/dev/null 2>&1 \
    && ok "SSHD " "sshd is running" || warn "SSHD " "sshd not detected"
fi

# SHELL, your login shell
ok "SHELL" "login shell is ${SHELL##*/}"

# tmux / herdr, installed AND visible to a non-login SSH (how TermHub attaches)
for m in tmux herdr; do
  here=$(command -v "$m" 2>/dev/null)
  seen=$("$SHELL" -c "command -v $m" 2>/dev/null)
  if [ -n "$here" ] && [ -n "$seen" ]; then
    ok   "$m " "visible to SSH  ($here)"
  elif [ -n "$here" ]; then
    fail "$m " "installed at $here but a non-login SSH cannot see it, PATH trap"
  else
    warn "$m " "not installed"
  fi
done

# SLEEP, will the Mac stay reachable while you are away?
if [ "$os" = Darwin ]; then
  pmset -g 2>/dev/null | grep -qiE 'SleepDisabled +1| sleep +0' \
    && ok   "SLEEP" "the Mac is set to stay awake" \
    || warn "SLEEP" "the Mac may sleep and drop connections"
fi

echo "Done, any FAIL or WARN is explained on the page you copied this from."

Paste it into your host's terminal, or save it as host-check.sh and run bash host-check.sh.

What each line means

The multiplexer your phone can't see

On Apple-Silicon Homebrew hosts, /opt/homebrew/bin is often added from ~/.zprofile, which a non-login SSH never reads, so a healthy Herdr or tmux comes back as a FAIL. Fix it by adding Homebrew's path to your shell's non-login startup so every SSH session can find it:

# add to ~/.zshenv
export PATH="/opt/homebrew/bin:$PATH"

Keeping the host awake

A phone terminal can't wake a sleeping Mac. For a machine that should stay reachable, especially an overnight agent, set Energy Saver so it doesn't sleep, or run caffeinate while it matters.

Once every line is OK

Get TermHub

TermHub is live on Google Play. Install it and connect to your first host in a couple of minutes.

Get it on Google Play
Free to install. If anything snags, email us and we'll walk you through it.