Replies: 1 comment 1 reply
-
If running inside termux app context: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Termux has an excellent multi session feature. It is possible to open a new session by swiping from the left and selecting 'New Session' however I would like to automate it with a script. I am trying to use the activity manager (am) to launch a termux failsafe session from a bash script running in another termux session.
This code:
am start --user 0 -n com.termux/.app.TermuxActivity -a android.intent.action.RUN --ez com.termux.app.failsafe_session true --es com.termux.RUN_COMMAND_SESSION_ACTION '0'
returns an error:
According to the WIKI:
https://github.com/termux/termux-app/wiki/RUN_COMMAND-Intent#RUN_COMMAND-Intent-Command-Extras
there is a command extra that seems like it should work:
RUN_COMMAND_SERVICE.EXTRA_SESSION_ACTION
extra for for session action of foreground commands. This defaults toTERMUX_SERVICE.VALUE_EXTRA_SESSION_ACTION_SWITCH_TO_NEW_SESSION_AND_OPEN_ACTIVITY.
How can I integrate this into my am command with the correct syntax? I tried variations on this but none of them work:
`am start --user 0 -n com.termux/.app.TermuxActivity
-a android.intent.action.RUN
--ez com.termux.app.failsafe_session true
--es com.termux.RUN_COMMAND_SESSION_ACTION '0'
--es com.termux.RUN_COMMAND_SERVICE.EXTRA_SESSION_ACTION 'TERMUX_SERVICE.VALUE_EXTRA_SESSION_ACTION_SWITCH_TO_NEW_SESSION_AND_OPEN_ACTIVITY''
Beta Was this translation helpful? Give feedback.
All reactions