Docs / Terminal Multiplexers (tmux and screen)

Terminal Multiplexers (tmux and screen)

Master mobile multitasking with tmux and GNU screen using Casshper's latched modifier keys, custom keycode soft bars, and touch gestures.

Mobile Multitasking with Terminal Multiplexers

Terminal multiplexers like tmux and GNU screen are essential tools for remote administration, allowing you to run multiple persistent shell sessions, split panes, and detach long-running jobs. However, using multiplexers on a mobile touchscreen is often frustrating because traditional multiplexer control relies heavily on chorded prefix combinations like Ctrl+B (tmux) or Ctrl+A (screen).

Casshper eliminates touchscreen friction with One-Shot Latched Keys, Dedicated Multiplexer Soft-Key Bars, and Touch Gesture Sequences.

Unbreakable Remote Workflows

Running tmux or screen on your remote host keeps your build pipelines, database migrations, and development servers active if your connection drops. Pairing this with Casshper's background session persistence prevents Android from terminating your local shell session when swapping between mobile apps or running long tasks.

One-Shot Latched Modifier Control

Instead of struggling to hold down a touch modifier while typing another character, use Latch Mode on your soft key bar:

  1. Tap the Ctrl button on your soft-key bar. The button illuminates with an active highlight indicator, showing it is armed.
  2. Tap b on your on-screen keyboard (or a for screen). This sends Ctrl+B, and the latch immediately releases.
  3. Tap your multiplexer command key:
    • c — Create a new window.
    • % — Split the active pane vertically.
    • " — Split the active pane horizontally.
    • n / p — Jump to the next or previous window.
    • o — Rotate through active panes.
    • d — Detach the session cleanly.

Dedicated Multiplexer Soft-Key Bar (Pro Admin)

For maximum speed, create a dedicated tmux Soft-Key Bar with Multi-Soft Key Bars (Pro Admin) that turns complex prefix sequences into single-tap actions:

Button LabelBinding TypeTarget / ValueOperational ModePurpose
Ctrl+BKeycode (KEYCODE)ASCII Hex 0x42 ('B') + CtrlPress / LatchSends tmux prefix directly without opening keyboard
Ctrl+AKeycode (KEYCODE)ASCII Hex 0x41 ('A') + CtrlPress / LatchSends GNU screen prefix directly
New WinText (TEXT)tmux new-windowPressCreates a new window via direct command execution
Split |Text (TEXT)tmux split-window -hPressSplits pane horizontally / side-by-side
Split —Text (TEXT)tmux split-window -vPressSplits pane vertically / top-and-bottom
Next →Text (TEXT)tmux next-windowPressSwitches to next window
← PrevText (TEXT)tmux previous-windowPressSwitches to previous window
DetachText (TEXT)tmux detach-clientPressDetaches session cleanly to background
Default ⇥Action (ACTION)Swap Soft-Key Bar (Default)PressReturns to your default navigation bar

Touch Gestures and Headless Key Control (Pro Admin)

Combine soft keys with Casshper's Custom Gestures (Pro Admin) for keyboard-free terminal and multiplexer control:

  • One-Shot Latched Prefix Gestures: Configure a gesture (like Tap + Swipe Right) to dispatch Ctrl+B or Ctrl+A in Latch mode. A quick flick arms your multiplexer prefix for the very next keystroke—tap % or c on your on-screen keyboard to execute splits or create windows without complex finger gymnastics.
  • Emergency Interrupts (Ctrl+C): Map a downward flick (Tap + Swipe Down ⚡) to send Ctrl+C immediately, killing runaway jobs or stuck processes inside any tmux pane.
  • Modal Escaping (Escape): Map an upward flick (Tap + Swipe Up ⚡) to send Escape, dropping out of copy mode, search mode, or Vim insert mode inside a pane without touching the keyboard.
  • Multiplexer Soft Bar Swapping: Map a gesture like Double Tap + Swipe Up to Swap Soft-Key Bar, instantly toggling your dedicated tmux soft-key bar into view when needed and hiding it when you need full screen space.
  • Session and Window Navigation: Use Double Tap + Swipe Left/Right to jump across active Casshper sessions or tmux windows effortlessly.

Mobile-Optimized Multiplexer Configuration

Recommended ~/.tmux.conf

Add these configuration directives to your remote server's ~/.tmux.conf for the best mobile experience:

# Enable native touch scrolling and tap-to-focus panes
set -g mouse on

# Eliminate escape delay for responsive Neovim/Vim editing
set -s escape-time 0

# Start window and pane numbering at 1 for easier thumb access
set -g base-index 1
setw -g pane-base-index 1

# Modern 24-bit True Color support matching Ghostty engine
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-ghostty:RGB"
Terminfo and SSH Remote Server Setup

Casshper is powered by the Ghostty engine and advertises TERM=xterm-ghostty. When connecting to remote servers, ensuring the remote host has the proper terminfo entry guarantees full 24-bit True Color and rich escape sequence fidelity. See our Terminfo Troubleshooting Guide for instructions on copying xterm-ghostty to your remote host via SSH.

Recommended ~/.screenrc

If you use GNU screen, add the following to your ~/.screenrc:

# Disable startup copyright splash screen
startup_message off

# Set generous scrollback buffer
defscrollback 10000

# Top caption line for active window indicators
caption always "%{= kw}%-w%{= kG}%{+b}[%n %t]%{-b}%{= kw}%+w"

Reconnecting to Persistent Sessions

When reconnecting to an SSH host from Casshper, use this one-line command or add it to your ~/.zshrc alias list to automatically attach to an existing session or start a new one:

tmux attach-session -t main || tmux new-session -s main
Pro Tip: Viewport Scaling with Split Panes

When working with multiple split panes in tmux on smaller mobile screens, adjust Casshper's Render Knobs (Columns and Render Scale) to fit high-density dashboards without font clipping.