When `Logger.CURRENT_LOG_LEVEL` set by user is `Logger.LOG_VERBOSE`, then background (not foreground sessions) command output was being logged to logcat, however, if command outputted too much data to logcat, then logcat clients like in Android Studio would crash. Also if a logcat dump is being taken inside termux, then duplicate lines would occur, first one due to of original entry, and second one due to StreamGobbler logging output at verbose level for logcat command. This would be a concern for plugins as well like `RUN_COMMAND` intent or Termux:Tasker, etc if they ran commands with lot of data and user had set log level to verbose. For plugins, TermuxService now supports `com.termux.execute.background_custom_log_level` `String` extra for custom log level. Termux:Tasker, etc will have to be updated with support. For `RUN_COMMAND` intent, the `com.termux.RUN_COMMAND_BACKGROUND_CUSTOM_LOG_LEVEL` `String` extra is now provided to set custom log level for only the command output. Check `TermuxConstants`. So one can pass a custom log level that is `>=` to the log level set it termux settings where (OFF=0, NORMAL=1, DEBUG=2, VERBOSE=3). If you pass `0`, it will completely disable logging. If you pass `1`, logging will only be enabled if log level in termux settings is `NORMAL` or higher. If custom log level is not passed, then old behaviour will remain and log level in termux settings must be `VERBOSE` or higher for logging to be enabled. Note that the log entries will still be logged with priority `Log.VERBOSE` regardless of log level, i.e `logcat` will have `V/`. The entries logcat component has now changed from `StreamGobbler` to `TermuxCommand`. For output at `stdout`, the entry format is `[<pid>-stdout] ...` and for the output at `stderr`, the entry format is `[<pid>-stderr] ...`. The `<pid>` will be process id as an integer that was started by termux. For example: `V/TermuxCommand: [66666-stdout] ...`. While doing this I realize that instead of using `am` command to send messages back to tasker, you can use tasker `Logcat Entry` profile event to listen to messages from termux at both `stdout` and `stderr`. This might be faster than `am` command intent systems or at least possibly more convenient in some use cases. So setup a profile with the `Component` value set to `TermuxCommand` and `Filter` value set to `-E 'TermuxCommand: \[[0-9]+-((stdout)|(stderr))\] message_tag: .*'` and enable the `Grep Filter` toggle so that entry matching is done in native code. Check https://github.com/joaomgcd/TaskerDocumentation/blob/master/en/help/logcat%20info.md for details. Also enable `Enforce Task Order` in profile settings and set collision handling to `Run Both Together` so that if two or more entries are sent quickly, entry task is run for all. Tasker currently (v5.13.16) is not maintaining order of entry tasks despite the setting. Then you can send an intent from tasker via `Run Shell` action with `root` (since `am` command won't work without it on android >=8) or normally in termux from a script, you should be able to receive the entries as `@lc_text` in entry task of tasker `Logcat Entry` profile. The following just passes two `echo` commands to `bash` as a script via `stdin`. If you don't have root, then you can call a wrapper script with `TermuxCommand` function in `Tasker Function` action that sends another `RUN_COMMAND` intent with termux provide `am` command which will work without root. ``` am startservice --user 0 -n com.termux/com.termux.app.RunCommandService -a com.termux.RUN_COMMAND --es com.termux.RUN_COMMAND_PATH '/data/data/com.termux/files/usr/bin/bash' --es com.termux.RUN_COMMAND_STDIN 'echo "message_tag: Sending message from tasker to termux"' --ez com.termux.RUN_COMMAND_BACKGROUND true --es com.termux.RUN_COMMAND_BACKGROUND_CUSTOM_LOG_LEVEL '1' ```
Termux application
Termux is an Android terminal application and Linux environment.
Note that this repository is for the app itself (the user interface and the terminal emulation). For the packages installable inside the app, see termux/termux-packages.
Quick how-to about Termux package management is available at Package Management. It also has info on how to fix repository is under maintenance or down
errors when running apt
or pkg
commands.
@termux is looking for Termux Application maintainers for implementing new features, fixing bugs and reviewing pull requests since the current one (@fornwall) is inactive.
Issue https://github.com/termux/termux-app/issues/1072 needs extra attention.
Contents
Termux App and Plugins
The core Termux app comes with the following optional plugin apps.
Installation
Termux can be obtained through various sources listed below for only Android >= 7
. Support was dropped for Android 5
and 6
on 2020-01-01 at v0.83
, old builds are available on archive.org.
The APK files of different sources are signed with different signature keys. The Termux
app and all its plugins use the same sharedUserId com.termux
and so all their APKs installed on a device must have been signed with the same signature key to work together and so they must all be installed from the same source. Do not attempt to mix them together, i.e do not try to install an app or plugin from F-Droid and another one from a different source. Android Package Manager will also normally not allow installation of APKs with different signatures and you will get errors on installation like App not installed
, Failed to install due to an unknown error
, INSTALL_FAILED_UPDATE_INCOMPATIBLE
, INSTALL_FAILED_SHARED_USER_INCOMPATIBLE
, signatures do not match previously installed version
, etc. This restriction can be bypassed with root or with custom roms.
If you wish to install from a different source, then you must uninstall any and all existing Termux or its plugin app APKs from your device first, then install all new APKs from the same new source. Check Uninstallation section for details. You may also want to consider Backing up Termux before the uninstallation.
F-Droid
Termux application can be obtained from F-Droid here. It usually takes a few days (or even a week or more) for updates to be available on F-Droid once an update has been released on Github. F-Droid releases are built and published by F-Droid once they detect a new Github release. The Termux maintainers do not have any control over the building and publishing of the Termux app on F-Droid. Moreover, the Termux maintainers also do not have access to the APK signing keys of F-Droid releases, so we cannot release an APK ourselves on Github that would be compatible with F-Droid releases.
Debug Builds
For users who don't want to wait for F-Droid releases and want to try out the latest features immediately or want to test their pull requests can get the APKs from Github Actions page from the workflow runs labelled Build
. The APK will be listed under Artifacts
section. These are published for each commit done to the repository. These APKs are debuggable and are also not compatible with other sources.
Google Playstore (Deprecated)
Termux and its plugins are no longer updated on Google playstore due to android 10 issues. The last version released for Android >= 7
was v0.101
. There are currently no immediate plans to resume updates on Google playstore. It is highly recommended to not install Termux from playstore for now. Any current users should switch to a different source like F-Droid.
If for some reason you don't want to switch, then at least check Package Management to change your mirror, otherwise, you will get repository is under maintenance or down
errors when running apt
or pkg
commands. After that, it is also highly advisable to run pkg upgrade
command to update all packages to the latest available versions, or at least update termux-tools
package with pkg install termux-tools
command.
Uninstallation
Uninstallation may be required if a user doesn't want Termux installed in their device anymore or is switching to a different install source. You may also want to consider Backing up Termux before the uninstallation.
To uninstall Termux completely, you must uninstall any and all existing Termux or its plugin app APKs listed in Termux App and Plugins.
Go to Android Settings
-> Applications
and then look for those apps. You can also use the search feature if it’s available on your device and search termux
in the applications list.
Even if you think you have not installed any of the plugins, it’s strongly suggesting to go through the application list in Android settings and double-check.
Important Links
Community
All community links are available here.
The main ones are the following.
- Termux Reddit community
- Termux Matrix Channel
- Termux Dev Matrix Channel
- Termux Twitter
- Termux Reports Email
Wikis
Miscellaneous
- FAQ
- Termux File System Layout
- Differences From Linux
- Package Management
- Remote_Access
- Backing up Termux
- Terminal Settings
- Touch Keyboard
- Android Storage and Sharing Data with Other Apps
- Android APIs
- Moved Termux Packages Hosting From Bintray to IPFS
- Termux and Android 10
Terminal resources
Terminal emulators
-
VTE (libvte): Terminal emulator widget for GTK+, mainly used in gnome-terminal. Source, Open Issues, and All (including closed) issues.
-
iTerm 2: OS X terminal application. Source, Issues and Documentation (which includes iTerm2 proprietary escape codes).
-
Konsole: KDE terminal application. Source, in particular tests, Bugs and Wishes.
-
hterm: JavaScript terminal implementation from Chromium. Source, including tests, and Google group.
-
xterm: The grandfather of terminal emulators. Source.
-
Connectbot: Android SSH client. Source
-
Android Terminal Emulator: Android terminal app which Termux terminal handling is based on. Inactive. Source.
For Devs and Contributors
The termux-shared library was added in v0.109
. It defines shared constants and utils of the Termux app and its plugins. It was created to allow for the removal of all hardcoded paths in the Termux app. The termux plugins will hopefully use this in future as well. If you are contributing code that is using a constant or a util that may be shared, then define it in termux-shared
library if it currently doesn't exist and reference it from there. Update the relevant changelogs as well. Pull requests using hardcoded values will/should not be accepted.
The main Termux constants are defined by TermuxConstants
class. It also contains information on how to fork Termux or build it with your own package name. Changing the package name will require building the bootstrap zip packages and other packages with the new $PREFIX
, check Building Packages for more info.