You can disable the phantom process killer in developer settings in Android 14.
Termux is rock solid on my Galaxy Fold 4 without any root or adb shenanigans.
It still killed Linux desktop environments after a couple of minutes for me when I tried it.
It still killed Linux desktop environments after a couple of minutes for me when I tried it.