If `ReportActivity` was started with a large report, i.e a few hundred `KB`, like for terminal transcript or other command output, the activity start would fail. To solve the issue, if the serialized size of the ReportInfo info object is above `DataUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES` (`100KB`), it will be saved to a file in a cache directory `/data/data/com.termux/cache/report_activity` as a serialized object and loaded when activity is started. The file will be automatically deleted when activity is destroyed (`Activity.onDetroy()`) or when notification that would have started the activity is deleted (`Notification.deleteIntent`). In case, these two didn't happen, then on `TermuxActivity` startup, a thread will be started to delete files older than `14` days so that unneeded left over files are deleted. If user tries to open plugin error or crash report notifications after 14 days, they will get `ReportInfo` file not found errors, assuming `TermuxActivity` was started to run the cleanup routine. Now these large reports can't be copied or shared with other apps since that would again result in `TransactionTooLargeException` exceptions and `ShareUtils` automatically truncates the data (now from end) to `100KB` length so that the exception doesn't occur. So now a `Save To File` option has been added in context menu (3 dots on top right) of `ReportActivity` so that large or small reports can be saved to a file if needed. They will be save in root of `/storage/emulated/0` or whatever is the default public external storage directory. The filename would depend on type of report. The storage permissions will be asked if missing. On android `11`, if you get permission denied errors even after granting permission, disable permission and grant it again. To solve privacy issues of report being saved to public storage since it may contain private info, an option for custom path will be added in future. The default directory is public storage instead of termux home since its easily accessible via all file managers or from pc. Instructing amateur users to get files via `SAF` from termux home is not something I wanna take on. Another issue is that `ReportActivity` itself may not be able to show the entire report since Android may throw `OutOfMemoryError` exceptions if device memory is low. To solve this issue, `ReportActivity` will truncate the report to `1MB` from end that's shown to the user. It will add a header showing that report was truncated. To view the full report, the user will have to use the `Save To File` option and view the file in an external app or on pc that supports opening large files. The `QuickEdit` app on Android has been a reliable one in my experience that supports large files, although it has max row/column limits too at a few hundred thousand, depending on android version. Despite all this, `OutOfMemoryError` exceptions could still be thrown if you try to view too large a report, like a few MB, since original report + the truncated report is still held in memory by the app and will consume `2-3` times memory when saving. It's fun coding for android, right? The terminal transcript will not be truncated anymore that's generated via `Report Issue` option in terminal. The `ShareUtils.copyTextToClipboard()` will truncate data now automatically, apparently all phones don't do it automatically and exception is raised. The `ShareUtils.saveTextToFile()` has been added that will automatically ask for storage permissions if missing. The `ReportInfo` now expects a `reportSaveFileLabel` and `reportSaveFilePath` arguments so that `ReportActivity` can use them to know where to save the file if users selects `Save To File` option. The `ReportActivityBroadcastReceiver` must now be registered in `AndroidManifest.xml` if you are using `ReportActivity` in your app. Check `ReportActivity` javadoc for details. Moreover, an incremental call to `ReportActivity.deleteReportInfoFilesOlderThanXDays()` must also be made.
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.