v5.31.0 — auto-reconnect setting + tunnel-only SSH (#150)
A Ko-fi supporter wrote: "Excellent evolved SSH client. Please consider adding an auto-reconnect setting as well as port forwarding without a shell." — both halves landed in this release.
Phase A — auto-reconnect setting (cd7748da)
The existing 5-attempt backoff loop in SshSessionManager.attemptReconnect was unconditional. Three new per-profile knobs gate it, all with defaults that preserve current behaviour:
- Auto-reconnect on disconnect (default on) — opt-out for users on noisy links who'd rather see the failure cleanly than endure a retry storm.
- Max attempts (default
5,0= unlimited) — for tunnel-only profiles holding port forwards alive. - Reconnect on network change (default on) — gates the existing
NetworkMonitor-driven flip path independently. Some users want on-disconnect retry but not flip-driven retry, and vice versa.
UI lives in the SSH section of the connection editor.
Phase B — tunnel-only SSH mode (152fb8f1)
New per-profile flag. When on, the connect path brings up the SSH transport, registers the configured port forwards, and does not allocate a PTY or open a terminal tab. The session runs in the background carrying just the forwards — equivalent to ssh -N -L 8080:localhost:80 host.
Compose with Phase A's unlimited reconnect for the autossh -M 0 equivalent: a profile that exists solely to keep localhost:8080 → home.example.com:80 alive across drops and network flips.
MCP follow-up (c308abfa)
create_connection gained the tunnelOnly argument so the integration test loop can drive a tunnel-only profile end-to-end without touching the device UI. list_connections surfaces non-default reconnect / tunnelOnly flags.
Honest scope notes
- The new
autoReconnectflag has no effect on Mosh / ET sessions yet. Mosh's UDP roaming layer handles short network flips internally — the most common case. ET would benefit but needs a transport-levelEtSession.reconnect()swap method analogous to SSH's, which is a separate change rather than a thin manager helper. BothonDisconnectedcallbacks now log the gap so anyone debugging "why didn't auto-reconnect fire on Mosh?" finds the explanation in logcat. Track in #150 — happy to take a PR.
Smaller things
- 26/26 SshSessionManagerTest cases pass including the 3 new gating tests (auto-reconnect=false skipped from
requestReconnectAll, on-network-change=false skipped, both-on flagged for reconnect).
Full Changelog: v5.30.0...v5.31.0