Persistent Sessions (tmux)

One of the biggest frustrations with mobile SSH is losing your session when the app goes to the background, your network drops, or you switch Wi-Fi networks. RemoteConsoleSSH solves this with built-in tmux integration. Your terminal session persists on the server even when the app is not connected.

How It Works

When you connect to a server, RemoteConsoleSSH automatically handles tmux for you:

1

App checks for tmux

On connection, the app runs a quick check to see if tmux is installed on the remote server.

2

Session created or reattached

If tmux is available, the app creates a new tmux session named remoteconsole-{connection-id} or reattaches to an existing one with that name. This happens transparently -- you see a normal terminal prompt.

3

Your session persists

Everything you do in the terminal happens inside the tmux session. If the connection drops, your processes keep running on the server. When you reconnect, the app reattaches to the same session and restores your terminal exactly as you left it.

💡

Tip

You do not need to know tmux to benefit from this. RemoteConsoleSSH handles session creation, attachment, and reattachment automatically. But if you are a tmux power user, all your shortcuts and configurations still work.

Session Management Screen

Access the session management screen by tapping the Sessions tab while connected to a server. From here you can manage all tmux sessions on the remote machine.

What You Can Do

  • View all sessions -- See a list of every active tmux session on the server, including sessions created outside of RemoteConsoleSSH.
  • Create a new session -- Tap New Session and enter a name. The app creates a new tmux session and attaches to it.
  • Attach to a session -- Tap any session in the list to detach from your current session and attach to the selected one.
  • Kill a session -- Swipe left on a session or tap the delete button to terminate it. This kills all processes running inside that session.
âš ī¸

Warning

Killing a tmux session terminates all processes running inside it. Make sure you have saved any work before killing a session.

Switching Between Sessions

You have two ways to switch between tmux sessions:

From the Sessions Screen

The simplest method. Open the Sessions tab, see all available sessions, and tap the one you want to switch to. The app handles detaching from the current session and attaching to the new one.

Using tmux Keyboard Shortcuts

If you prefer keyboard shortcuts, the standard tmux key bindings work. The default prefix key is Ctrl+B:

ShortcutAction
Ctrl+B then sList all sessions (interactive picker)
Ctrl+B then (Switch to previous session
Ctrl+B then )Switch to next session
Ctrl+B then $Rename current session
Ctrl+B then dDetach from current session
💡

Tip

The keyboard toolbar has a dedicated tmux tab with one-tap access to the prefix key and common tmux operations. See the keyboard toolbar guide for details.

Reconnection and Auto-Recovery

When your connection drops -- whether from a network switch, airplane mode, or the app being suspended by the OS -- RemoteConsoleSSH handles recovery automatically.

The Reconnection Flow

  1. Connection lost -- The app detects the SSH connection has dropped and shows a "Reconnecting..." status indicator.
  2. Exponential backoff -- The app retries the connection with increasing intervals: 2 seconds, 4 seconds, 8 seconds, 16 seconds, 32 seconds. Up to 5 attempts total.
  3. Reconnect -- Once the network is available again, the SSH connection is re-established using your saved credentials.
  4. Reattach to tmux -- The app automatically reattaches to your tmux session. Your terminal buffer, running processes, and cursor position are all restored.
Connection Lost → Reconnecting (2s, 4s, 8s, 16s, 32s) → Reconnected → tmux Reattached
â„šī¸

Info

During reconnection, your processes continue running on the server inside the tmux session. A long-running build, a file download, or a monitoring tool will keep running regardless of what happens to the app.

What Gets Preserved

  • Your terminal scrollback buffer
  • All running processes (builds, scripts, watchers)
  • Your current working directory
  • Any text you had typed but not yet submitted
  • tmux window and pane layout

Multi-Device Access

One of the most powerful features of tmux is that the same session can be accessed from multiple devices simultaneously.

How It Works

Because the tmux session lives on the server, any SSH client that attaches to it sees the same terminal. This means:

  • Start a session on your iPhone during your commute
  • Continue the same session on your laptop when you get to your desk
  • Monitor progress from your iPad while working on something else

Changes appear in real-time on all connected devices. If you type a command on one device, every other device attached to the same session sees it instantly.

Use Cases

  • Pair programming -- Share a terminal session with a colleague. They attach to the same tmux session from their own device and you can work together in real time.
  • Multi-device monitoring -- Keep a monitoring dashboard on your phone while working on your laptop.
  • Seamless transitions -- Start work on one device, pick it up on another without losing context.
💡

Tip

To access the same session from a different device, simply connect to the same server. If the app finds an existing remoteconsole-* session, it will offer to reattach to it. You can also go to the Sessions screen and attach to any session by name.

What Happens Without tmux

If tmux is not installed on the server, RemoteConsoleSSH still works -- but you lose the persistence features:

FeatureWith tmuxWithout tmux
Session survives disconnectYesNo
Running processes preservedYesNo -- processes receive SIGHUP and terminate
Auto-recovery on reconnectYes -- reattaches to sessionNo -- starts a fresh session
Multi-device accessYesNo
Terminal buffer preservedYesNo -- buffer is lost
âš ī¸

Warning

Without tmux, losing your connection means losing everything in that session. Running processes are terminated, your scrollback is gone, and you start fresh on reconnect. We strongly recommend installing tmux on any server you connect to regularly.

Installing tmux

If tmux is not installed, here is how to install it on common platforms:

PlatformCommand
macOS (Homebrew)brew install tmux
Ubuntu / Debiansudo apt-get install -y tmux
CentOS / RHELsudo yum install -y tmux
Fedorasudo dnf install -y tmux
Arch Linuxsudo pacman -S tmux

See the tmux installation guide for more details and verification steps.

What's Next