Termux-app: Termux notification persists after exit with wake-lock

Created on 12 Feb 2017  路  3Comments  路  Source: termux/termux-app

This can be reproduced by creating a session, pulling down the notification shade, enabling the wakelock, then killing all sessions with either exit or long-press then kill process, and pushing enter to exit.
The result is the notification displaying 0 sessions (wake lock held).

Most helpful comment

Right, this is intended - the reasoning is that you probably take the wake lock to hold a background service awake (e.g. a web server or sshd), and if so you want to continue staying awake even with no terminal sessions.

Let me know if you want to modify this behaviour (and if so, why) - otherwise the current behaviour remains (and we can add information about it to the help pages).

All 3 comments

I can't reproduce this using the first two methods (if I understood correctly, both pressing exit in the notification or killing the app from Android app info correctly clears the notification) however, I can reproduce this by pressing Ctrl+D followed by Enter. Choosing Exit or Release Wakelock in the notification afterwards clears it.
After looking at TermuxService.java I think this is intended behavior, the lock only gets released when the user does it manually. It would be easy to change this so the locks automatically get released after the last session exits, but maybe there's a reason why it was implemented this way?

Right, this is intended - the reasoning is that you probably take the wake lock to hold a background service awake (e.g. a web server or sshd), and if so you want to continue staying awake even with no terminal sessions.

Let me know if you want to modify this behaviour (and if so, why) - otherwise the current behaviour remains (and we can add information about it to the help pages).

Right, this is intended - the reasoning is that you probably take the wake lock to hold a background service awake (e.g. a web server or sshd), and if so you want to continue staying awake even with no terminal sessions.

Let me know if you want to modify this behaviour (and if so, why) - otherwise the current behaviour remains (and we can add information about it to the help pages).

Thanks

Was this page helpful?
0 / 5 - 0 ratings