How to Control Termux Sessions via Scripting? #4822
Unanswered
clavdivs-ptolemaevs
asked this question in
Q&A
Replies: 1 comment 2 replies
-
|
I dont known is termux can do that, nb: tmux should be installed in termux environment |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was able to successfully start a new session from bash with the following command:
am startservice -n com.termux/.app.TermuxService -a com.termux.service_executeEven adding a title worked fine (I am referring to the real title in bold, not the "terminal title" in italics that you can change via ANSI escape sequences):
am startservice -n com.termux/.app.TermuxService -a com.termux.service_execute --es com.termux.execute.shell_name "My Session Name"However, I was unable to keep the current session in the foreground while creating the new one. I tried using the session action extra for the service execute intent, but to no avail:
--es com.termux.execute.session_action "VALUE_EXTRA_SESSION_ACTION_KEEP_CURRENT_SESSION_AND_OPEN_ACTIVITY"and
--es com.termux.execute.session_action "VALUE_EXTRA_SESSION_ACTION_KEEP_CURRENT_SESSION_AND_DONT_OPEN_ACTIVITY"I also tried to pass the corresponding integer directly, which did not work either:
--ei com.termux.execute.session_action 1resp.
--ei com.termux.execute.session_action 3So, I have a couple of questions about using the activity manager to control Termux sessions:
Is it at all possible to add new sessions to the sidebar without bringing them to the foreground?
Is it possible to close a specific session without killing the whole service?
Is it possible to switch between sessions?
Is it possible to add a title to the very first session (or, more generally, to apply com.termux.execute.shell_name to the current session without creating a new one)?
Many thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions