Keeping SSH connections alive on iOS with high-fidelity terminal emulation and without draining your battery: the Story of El Preservador.

https://blog.xibbon.com/solving-background-disconnect-issues-on-ios-with-el/

El Preservador: SSHing Responsibly on iOS

With La Terminal, we strive to offer an SSH client that just works on iOS. With this in mind, I set out to make design decisions on behalf of users that would provide an experience that works out of the box while providing the best terminal emulator experience they deserve.

Xibbon Blog

@Migueldeicaza if I actively exit/logoff, should the preserver not exit completely?

It isn't for me, and it's not being reused when a new connection is made, so if you disconnect cleanly and reconnect each time you end up spawning another preserver....

@interpipes it should terminate if you end the session. If this is happening, I have a bug. What OS is the target, and shell you are using?
@Migueldeicaza Debian 11(.6) x64, currently running 5.10.0-20-amd64, regular plain old bash
@Migueldeicaza given it seems to be dynamic, if it is relevant, libc-2.31(-13+deb11u5)