@tareksander
Problem description and Steps to reproducd
termux-saf-managedir would pop a folder selection screen. If the user switch to other application or go to home screen.
Expected behavior
Either end the terminal blocking or let the selection screen stay in recents.
Additional information
My solution in the pull requests here is to let it stay in recent screens. I set android:excludeFromRecents="false" in AndroidManifest.xml and use finishAndRemoveTask(); replacing finish(); in the activity. I'm not very familiar with Android and not sure if there may be any side effects.
It solves the issue but there's more. If user swipes to kill the activity, it can't catch that to release the terminal. Just fyi, seems some stackoverflow solution is a service to monitor this.