termux-app
termux-app copied to clipboard
can we set *keep screen on* option through command line ?
Feature description Describe the feature and why you want it.
Reference implementation Does another app/terminal emulator have this feature? Provide links to more background information
Would probably be difficult to do as this would be implemented through termux-api. But the api for it requires the WindowManager (which only termux-app would have access to as far as I know) https://developer.android.com/reference/android/view/WindowManager.LayoutParams#FLAG_KEEP_SCREEN_ON
Probably doable with custom escape sequences. @agnostic-apollo?
Command line api would be the way to go here too, screens are independent of a terminal.
Yeah, but escape sequence can let terminal emulator know which session exactly asked to keep screen on and not apply this option to other sessions. Also command line api can invoke escape sequences so there will be no conflict there.
Screen on is not done per session, but for all sessions shown by the terminal view. Doing it per session would require management of states. Escape sequence api also needs to be implemented in future, so can see then.
https://github.com/termux/termux-app/blob/3b5018b4c79a2c2d218eb6fd570b2f2bebb8415a/app/src/main/java/com/termux/app/TermuxActivity.java#L753