tmux on Android

Phones lose connections all the time. With tmux on the server, your programs keep running when that happens, and Termexa puts you back in the same session. This page shows the setup and the tmux tools built into the app.

Why tmux matters on a phone

Set up tmux with Termexa

  1. Save the attach command. In the host's Command to run, enter tmux new -A -s main. It attaches to the session named main, or creates it. Termexa runs the same command whenever it reconnects, so you land back where you were.
  2. Add the tmux keys. In Settings → Shortcut panel, tap a slot and open the Plugins tab. The tmux row has previous/next window, new window, next/last pane, zoom, split left-right and top-bottom, copy mode and detach; pane-by-direction, close pane and the window and session lists are there too. Termexa sends the prefix for you.
  3. Use the Navigator. Add the Navigate key. It reads your tmux sessions, windows and panes over SSH and shows them as a list; tap one and the terminal goes there.
  4. Copy to the phone. With clipboard support turned on in tmux, text you copy in tmux can land on the phone clipboard. Termexa asks once per host, and a server can never read your clipboard.

Example: ~/.tmux.conf

# text copied in tmux goes to the phone clipboard (OSC 52)
set -g set-clipboard on
# lets Termexa's "command finished" alerts work inside tmux
set -g allow-passthrough on

The finish alerts also need a few lines of shell integration for bash or zsh (fish 4 has it built in). The Getting started guide has them.

Read long output

Use the copy mode key to scroll back through tmux history, and q to leave it. Zoom makes the current pane fill the screen, which helps on a narrow phone.

Herdr works too

Termexa supports Herdr, a multiplexer for running several terminals and coding agents on one screen, in the same way: save herdr --session main as the command to run. In Herdr, the Navigator also marks panes where an agent is waiting for input.

Frequently asked questions

Do I need tmux to use Termexa?

No. Termexa works as a plain SSH shell. tmux or Herdr adds the Navigator, the multiplexer keys and sessions that survive a dropped connection.

Will my programs keep running if the phone disconnects?

Inside tmux, yes: they keep running on the server and Termexa reattaches with the saved command. In a plain shell without a multiplexer, programs may stop when the connection closes.

Which tmux prefix does Termexa send?

Ctrl+B by default, the same as tmux. The tmux keys in the toolbar send the prefix and the command key together.

Can I see all my tmux sessions on the phone?

Yes. The Navigator lists sessions, windows and panes and takes the terminal to the one you tap.

Does copying in tmux reach the phone clipboard?

Yes, with set-clipboard on in tmux. Termexa asks once per host before it accepts clipboard writes from that server.

Related guides

Try Termexa

Android 13+ · No account · No ads · No tracking

Get it on Google Play Coming soon Getting started