Skip to content

feat(android): keep ssh sessions alive in the background - #5

Merged
iscekic merged 2 commits into
mainfrom
feat/background-sessions
Nov 13, 2026
Merged

iscekic merged 2 commits into
mainfrom
feat/background-sessions

Conversation

@iscekic

@iscekic iscekic commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Keeps SSH sessions alive on Android while the app is in the background, using a foreground service of type specialUse with an ongoing notification and a Disconnect all action. Adds a one-shot idle notification for a shell whose command finishes while the app is in the background. Notification texts come from JavaScript so apps can localise them. The config plugin adds the manifest entries; iOS exposes the same API as no-ops, because iOS does not allow background sockets.

Verified on an Android emulator against the OpenSSH test container: the same TCP connection stays established after twelve minutes in the background and the shell keeps working on return; the idle notification fires only while backgrounded; Disconnect all closes every session and stops the service. The macOS CI job verifies the iOS build.

Android runs a specialUse foreground service while at least one session is
open, with an ongoing notification whose texts come from JavaScript and a
disconnect action that closes every session natively. notifyWhenIdle reports a
command that finished while the app is off screen. iOS resolves the same calls
without a keepalive.
Keeps both sides: the background session events, service wiring and JS API
coexist with the SFTP, transfer and forwarding APIs and the jump-host connect
path. The session counter still bounds the foreground service, and every SFTP
client or forward requires an open session, so those paths keep it running.
@iscekic
iscekic merged commit b65f2a4 into main Nov 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant