Docs / Session Persistence and SSH Agent

Session Persistence and SSH Agent

Keep terminal sessions active in the background and manage SSH identities with Casshper's background session service.

Background Execution and Identity Persistence

Maintaining active SSH connections while switching apps or responding to notifications is essential for mobile administration. Casshper keeps your terminal sessions connected in the background using dedicated service management, preventing session drops when switching between mobile applications.

Background Execution

Active terminal sessions run as a background foreground service with a persistent status bar notification, allowing you to multitask freely without interrupting your work.

Android Process Persistence vs. Network Roaming

Session persistence in Casshper is designed specifically for Android process lifecycle management. Running as an Android foreground service with a persistent notification protects your local terminal processes and background tasks from being reclaimed by the OS when swapping between apps or running long tasks in the background. Because Casshper uses standard SSH (TCP) rather than roaming UDP protocols like mosh, mobile network drops or IP address changes will disconnect the socket. To preserve remote state across network changes, pair Casshper with remote multiplexers such as tmux or screen.

Core Features

  • Persistent Background Connection: Active shell sessions remain connected while checking web pages, reading documentation, or switching apps.
  • Builtin SSH Agent: Manages active identity keys to streamline key usage across multiple SSH hosts without re-entering passphrases.
  • Notification Controls: Monitor active background sessions at a glance and safely close sessions directly from the Android notification shade.

Session Navigation and Quick Actions

Switching between active background sessions is effortless with Casshper's built-in session action commands:

  • Active Session Sidebar Highlighting: In the navigation drawer sidebar, the active foreground session is styled with distinct top and bottom border accent lines rendered in the session theme's foreground color, giving you instantaneous visual feedback of your active session buffer.
  • Next and Previous Session: Rapidly cycle through open background terminal tabs with dedicated soft keys or swipe gestures.
  • New and Close Session: Spawn a new shell or safely terminate background buffers without digging into navigation drawers.
  • Toggle Sessions Sidebar: Expand or collapse the active sessions drawer with a single tap.
  • Action Reference: Learn how to map these commands to toolbars and swipe gestures in Action Bindings and Terminal Commands and Custom Gestures.