Go to file
dependabot[bot] 2f40df91e5 Changed: Bump gradle/wrapper-validation-action from 2 to 3
Bumps [gradle/wrapper-validation-action](https://github.com/gradle/wrapper-validation-action) from 2 to 3.
- [Release notes](https://github.com/gradle/wrapper-validation-action/releases)
- [Commits](https://github.com/gradle/wrapper-validation-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: gradle/wrapper-validation-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-18 21:12:09 +05:00
.github Changed: Bump gradle/wrapper-validation-action from 2 to 3 2024-04-18 21:12:09 +05:00
app Fixed: Fix toggle toolbar not working due to accidental comment of function in a56ed577 2023-08-14 20:45:30 +05:00
art icon: add regular png icon for compatibility with some launchers 2021-02-03 15:49:03 +02:00
docs/en Added: Add multi language i18n support for docs per termux/termux.github.io@f234d089e 2022-07-17 08:48:03 +05:00
fastlane/metadata/android/en-US add basic metadata for F-Droid. 2021-02-03 16:43:17 +02:00
gradle/wrapper Changed: Bump gradle to 7.2 2021-08-21 06:01:58 +05:00
terminal-emulator Fixed: Limit max combining characters in TerminalRow to 15 characters to prevent buffer overflows 2024-04-07 15:52:48 +05:00
terminal-view Fixed: Fix `SHIFT+PAGE_UP` and `SHIFT+PAGE_DOWN` behaviour to scroll `1` line of scrollback history instead of scrolling command history or changing pages 2023-05-21 07:58:35 +05:00
termux-shared Fixed: Allow numbers and hyphens in domain extension for url selector 2023-08-19 03:59:10 +05:00
.editorconfig Use 2 spaces for yaml files (.travis.yml) 2018-08-30 13:51:24 +02:00
.gitattributes Update .gitattributes 2021-05-14 08:05:08 +05:00
.gitignore Chore: Add vim swap files to .gitignore 2023-10-08 22:03:27 +02:00
LICENSE.md Update LICENSE.md as per 5252fbbe 2022-01-23 01:40:21 +05:00
README.md Changed: Update `Twitter` to `X (Twitter)` in README 2023-11-02 09:20:21 +05:00
build.gradle Changed: Use double quotes instead of single quotes for all gradle dependencies 2022-05-24 01:19:45 +05:00
gradle.properties Changed: Bump down `minSdkVersion` from `24` to `21` to restart supporting android 5/6 for the time being 2022-05-24 01:19:45 +05:00
gradlew gradle 6.6.1 2020-08-26 20:40:29 +03:00
gradlew.bat Normalize gradlew.bat 2021-05-14 08:41:15 +05:00
jitpack.yml Export JITPACK_NDK_VERSION for jitpack 2021-07-01 08:34:00 +05:00
settings.gradle Create termux-shared library package for all termux constants and shared utils 2021-04-07 11:31:30 +05:00

README.md

Termux application

Build status Testing status Join the chat at https://gitter.im/termux/termux Join the Termux discord server Termux library releases at Jitpack

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.

We are looking for Termux Android application maintainers.


NOTICE: Termux may be unstable on Android 12+. Android OS will kill any (phantom) processes greater than 32 (limit is for all apps combined) and also kill any processes using excessive CPU. You may get [Process completed (signal 9) - press Enter] message in the terminal without actually exiting the shell process yourself. Check the related issue #2366, issue tracker, phantom cached and empty processes docs and this TLDR comment on how to disable trimming of phantom and excessive cpu usage processes. A proper docs page will be added later. An option to disable the killing should be available in Android 12L or 13, so upgrade at your own risk if you are on Android 11, specially if you are not rooted.


Contents

Termux App and Plugins

The core Termux app comes with the following optional plugin apps.

Installation

Latest version is v0.118.0.

NOTICE: It is highly recommended that you update to v0.118.0 or higher ASAP for various bug fixes, including a critical world-readable vulnerability reported here. Also reminding again to users who have installed termux apps from google playstore that playstore builds are deprecated and no longer supported. It is recommended that you shift to F-Droid or GitHub releases.

Termux can be obtained through various sources listed below for only Android >= 7 with full support for apps and packages.

Support for both app and packages was dropped for Android 5 and 6 on 2020-01-01 at v0.83, however it was re-added just for the app without any support for package updates on 2022-05-24 via the GitHub sources. Check here for the details.

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 like GitHub. 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 so that you can restore it after re-installing from Termux different source.

In the following paragraphs, "bootstrap" refers to the minimal packages that are shipped with the termux-app itself to start a working shell environment. Its zips are built and released here.

F-Droid

Termux application can be obtained from F-Droid from here.

You do not need to download the F-Droid app (via the Download F-Droid link) to install Termux. You can download the Termux APK directly from the site by clicking the Download APK link at the bottom of each version section.

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. The 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 apps 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.

The F-Droid app often may not notify you of updates and you will manually have to do a pull down swipe action in the Updates tab of the app for it to check updates. Make sure battery optimizations are disabled for the app, check https://dontkillmyapp.com/ for details on how to do that.

Only a universal APK is released, which will work on all supported architectures. The APK and bootstrap installation size will be ~180MB. F-Droid does not support architecture specific APKs.

GitHub

Termux application can be obtained on GitHub either from GitHub Releases for version >= 0.118.0 or from GitHub Build Action workflows. For android >= 7, only install apt-android-7 variants. For android 5 and 6, only install apt-android-5 variants.

The APKs for GitHub Releases will be listed under Assets drop-down of a release. These are automatically attached when a new version is released.

The APKs for GitHub Build action workflows will be listed under Artifacts section of a workflow run. These are created for each commit/push done to the repository and can be used by users who don't want to wait for releases and want to try out the latest features immediately or want to test their pull requests. Note that for action workflows, you need to be logged into a GitHub account for the Artifacts links to be enabled/clickable. If you are using the GitHub app, then make sure to open workflow link in a browser like Chrome or Firefox that has your GitHub account logged in since the in-app browser may not be logged in.

The APKs for both of these are debuggable and are compatible with each other but they are not compatible with other sources.

Both universal and architecture specific APKs are released. The APK and bootstrap installation size will be ~180MB if using universal and ~120MB if using architecture specific. Check here for details.

Security warning: APK files on GitHub are signed with a test key that has been shared with community. This IS NOT an official developer key and everyone can use it to generate releases for own testing. Be very careful when using Termux GitHub builds obtained elsewhere except https://github.com/termux/termux-app. Everyone is able to use it to forge a malicious Termux update installable over the GitHub build. Think twice about installing Termux builds distributed via Telegram or other social media. If your device get caught by malware, we will not be able to help you.

The test key shall not be used to impersonate @termux and can't be used for this anyway. This key is not trusted by us and it is quite easy to detect its use in user generated content.

Keystore information
Alias name: alias
Creation date: Oct 4, 2019
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=APK Signer, OU=Earth, O=Earth
Issuer: CN=APK Signer, OU=Earth, O=Earth
Serial number: 29be297b
Valid from: Wed Sep 04 02:03:24 EEST 2019 until: Tue Oct 26 02:03:24 EEST 2049
Certificate fingerprints:
         SHA1: 51:79:55:EA:BF:69:FC:05:7C:41:C7:D3:79:DB:BC:EF:20:AD:85:F2
         SHA256: B6:DA:01:48:0E:EF:D5:FB:F2:CD:37:71:B8:D1:02:1E:C7:91:30:4B:DD:6C:4B:F4:1D:3F:AA:BA:D4:8E:E5:E1
Signature algorithm name: SHA1withRSA (disabled)
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Google Play Store (Deprecated)

Termux and its plugins are no longer updated on Google Play Store due to android 10 issues and have been deprecated. The last version released for Android >= 7 was v0.101. It is highly recommended to not install Termux apps from Play Store any more.

Termux developers do not have access to Play Store Console account where Termux is published and therefore can't remove the app. You are encouraged to move to F-Droid or GitHub builds as soon as possible and suggest doing so for other users via social media.

You will not need to buy plugins again if you bought them on Play Store. All plugins are free on F-Droid and GitHub.

You can backup all your data under $HOME/ and $PREFIX/ before changing installation source, and then restore it afterwards, by following instructions at Backing up Termux before the uninstallation.

There is currently no work being done to solve android 10 issues and working updates will not be resumed on Google Play Store any time soon. We will continue targeting sdk 28 for now. So there is not much point in staying on Play Store builds and waiting for updates to be resumed. If for some reason you don't want to move to F-Droid or GitHub sources for now, 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.

Note that by upgrading old packages to latest versions, like that of python may break your setups/scripts since they may not be compatible anymore. Moreover, you will not be able to downgrade the package versions since termux repos only keep the latest version and you will have to manually rebuild the old versions of the packages if required as per Building packages.

If you plan on staying on Play Store sources in future as well, then you may want to disable automatic updates in Play Store for Termux apps, since if and when updates to disable Termux apps are released, then you will not be able to downgrade and will be forced to move since apps won't work anymore. Only a way to backup termux-app data may be provided. The termux-tools version >= 0.135 will also show a banner at the top of the terminal saying You are likely using a very old version of Termux, probably installed from the Google Play Store., you can remove it by running rm -f /data/data/com.termux/files/usr/etc/motd-playstore and restarting the app.

Why Disable?

  • Play store apps have multiple critical vulnerabilities as reported at https://termux.github.io/general/2022/02/15/termux-apps-vulnerability-disclosures.html and since they cannot be updated with fixes, any users using older versions would be vulnerable.

  • They should be disabled because deprecated things get removed and are not supported after some time, its the standard practice. It has been many months now since deprecation was announced and updates have not been released on Play Store since after 29 September 2020.

  • The new versions have lots of new features and fixes which you can mostly check out in the Changelog of GitHub Releases that you may be missing out. Extra detail is usually provided in commit messages.

  • Users on old versions are quite often reporting issues in multiple repositories and support forums that were fixed months ago, which we then have to deal with. The maintainers of @termux work in their free time, majorly for free, to work on development and provide support and having to re-re-deal with old issues takes away the already limited time from current work and is not possible to continue doing. Play Store page of termux-app has been filled with bad reviews of "broken app", even though its clearly mentioned on the page that app is not being updated, yet users don't read and still install and report issues.

  • Asking people to pay for plugins when the termux-app at installation time is broken due to repository issues and has bugs is unethical.

  • Old versions don't have proper logging/debugging and crash report support. Reporting bugs without logs or detailed info is not helpful in solving them.

  • It's also easier for us to solve package related issues and provide custom functionality with app updates, which can't be done if users continue using old versions. For example, the bintray shutdown causing package install/update failures for new Play Store users is/was not an issue for F-Droid users since it is being shipped with updated bootstrap and repo info, hence no reported issues from new F-Droid users.

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 its 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 suggested to go through the application list in Android settings and double-check.

Community

All community links are available here.

The main ones are the following.

Wikis

Miscellaneous

Terminal

Terminal resources

Terminal emulators

Debugging

You can help debug problems of the Termux app and its plugins by setting appropriate logcat Log Level in Termux app settings -> <APP_NAME> -> Debugging -> Log Level (Requires Termux app version >= 0.118.0). The Log Level defaults to Normal and log level Verbose currently logs additional information. Its best to revert log level to Normal after you have finished debugging since private data may otherwise be passed to logcat during normal operation and moreover, additional logging increases execution time.

The plugin apps do not execute the commands themselves but send execution intents to Termux app, which has its own log level which can be set in Termux app settings -> Termux -> Debugging -> Log Level. So you must set log level for both Termux and the respective plugin app settings to get all the info.

Once log levels have been set, you can run the logcat command in Termux app terminal to view the logs in realtime (Ctrl+c to stop) or use logcat -d > logcat.txt to take a dump of the log. You can also view the logs from a PC over ADB. For more information, check official android logcat guide here.

Moreover, users can generate termux files stat info and logcat dump automatically too with terminal's long hold options menu More -> Report Issue option and selecting YES in the prompt shown to add debug info. This can be helpful for reporting and debugging other issues. If the report generated is too large, then Save To File option in context menu (3 dots on top right) of ReportActivity can be used and the file viewed/shared instead.

Users must post complete report (optionally without sensitive info) when reporting issues. Issues opened with (partial) screenshots of error reports instead of text will likely be automatically closed/deleted.

Log Levels
  • Off - Log nothing.
  • Normal - Start logging error, warn and info messages and stacktraces.
  • Debug - Start logging debug messages.
  • Verbose - Start logging verbose messages.

For Maintainers 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. Some of the termux plugins are using this as well and rest will in future. 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. Termux app and plugin specific classes must be added under com.termux.shared.termux package and general classes outside it. The termux-shared LICENSE must also be checked and updated if necessary when contributing code. The licenses of any external library or code must be honoured.

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.

Check Termux Libraries for how to import termux libraries in plugin apps and Forking and Local Development for how to update termux libraries for plugins.

The versionName in build.gradle files of Termux and its plugin apps must follow the semantic version 2.0.0 spec in the format major.minor.patch(-prerelease)(+buildmetadata). When bumping versionName in build.gradle files and when creating a tag for new releases on GitHub, make sure to include the patch number as well, like v0.1.0 instead of just v0.1. The build.gradle files and attach_debug_apks_to_release workflow validates the version as well and the build/attachment will fail if versionName does not follow the spec.

Commit Messages Guidelines

Commit messages must use the Conventional Commits spec so that chagelogs as per the Keep a Changelog spec can automatically be generated by the create-conventional-changelog script, check its repo for further details on the spec. The first letter for type and description must be capital and description should be in the present tense. The space after the colon : is necessary. For a breaking change, add an exclamation mark ! before the colon :, so that it is highlighted in the chagelog automatically.

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Only the types listed below must be used exactly as they are used in the changelog headings. For example, Added: Add foo, Added|Fixed: Add foo and fix bar, Changed!: Change baz as a breaking change, etc. You can optionally add a scope as well, like Fixed(terminal): Fix some bug. Do not use anything else as type, like add instead of Added, etc.

  • Added for new features.
  • Changed for changes in existing functionality.
  • Deprecated for soon-to-be removed features.
  • Removed for now removed features.
  • Fixed for any bug fixes.
  • Security in case of vulnerabilities.

Forking

  • Check TermuxConstants javadocs for instructions on what changes to make in the app to change package name.
  • You also need to recompile bootstrap zip for the new package name. Check building bootstrap, here and here.
  • Currently, not all plugins use TermuxConstants from termux-shared library and have hardcoded com.termux values and will need to be manually patched.
  • If forking termux plugins, check Forking and Local Development for info on how to use termux libraries for plugins.