v0.118.0
v0.118.0 - 2022-01-07 22.35
Changelog
Added
-
Allow users to directly open URL links in terminal transcript when clicked or tapped. The user can add
terminal-onclick-url-open=trueentry totermux.propertiesfile to enable opening of URL links in terminal transcript when clicked or tapped. The default value isfalse. Runningtermux-reload-settingscommand will also update the behaviour instantaneously if changed. Implemented by @trygveaa in #2146. (af16e79b,1a5a66d0) -
Allow users to disable auto capitalization of extra keys text. The user can add
extra-keys-text-all-caps=falseentry totermux.propertiesfile to disable auto capitalization of extra keys text for both normal and popup buttons. The default value istrue. Runningtermux-reload-settingscommand will also update the behaviour instantaneously if changed. (5c72c3ca) -
Allow users to adjust terminal horizontal and vertical margin. The
terminal-margin-horizontalkey can be used to adjust the terminal left/right margin and theterminal-margin-verticalcan be used to adjust the terminal top/bottom margin. This will also affect drawer. The user can set an integer value between0and100asdpunits. The default value is still3for horizontal and0for vertical margin. So adding an entry liketerminal-margin-horizontal=10totermux.propertiesfile will allow users to set a horizontal margin of10dp. After updating the value, either restart termux or runtermux-reload-settingsfor changes to take effect.This was added since for some users text on edges would not be shown on the screen or they had screen protectors/cases that covered screen edges (Of course, that would require fixing every single app and android system UI itself, so kinda stupid to use). Moreover, horizontal margin of like
10dpmay be helpful with peek-and-slide for people having gesture navigation enabled on android10+since they won't be to touch at exactly the edge of the screen to trigger peek (#1325).
Closes #2210(
63504f0a) -
Allow users to disable hardware keyboard shortcuts. The user can add
disable-hardware-keyboard-shortcuts=trueentry totermux.propertiesfile to disable hardware keyboard shortcuts. The default value isfalse. Runningtermux-reload-settingscommand will also update the behaviour instantaneously if changed. Note that forctrl+alt+pto work, you need to unsetshortcut.rename-session = ctrl + n. https://wiki.termux.com/wiki/Terminal_Settings. Closes #1825. (829cc398,fcc0d362) -
Request
android.permission.PACKAGE_USAGE_STATSpermission. The permission can be granted fromAndroid Settings->System->Usage Access. Closes #2269. (865f29d4) -
Add
TERMUX_API_VERSIONto termux shell environment. This can be used to check ifTermux:APIis installed and enabled for cases where users try to runtermux-apicommands and it hangs. (0cf3cef7) -
Add
TERMUX_IS_DEBUGGABLE_BUILD,TERMUX_APK_RELEASEandTERMUX_APP_PIDto termux shell environment.The
TERMUX_IS_DEBUGGABLE_BUILDenv variable will be set to1if termux APK is a debuggable APK and0otherwise. Note that thedev_keystore.jksshipped with termux app and plugin source code can also be used to create a release APK even though its mainly used for Github Debug Builds, in which case value will be0.The
TERMUX_APK_RELEASEwill be set toGITHUB,F_DROIDorGOOGLE_PLAY_STOREdepending on release type. It will be set toUNKNOWNif signed with a custom key.The
TERMUX_APP_PIDwill be set to the process of the main app process of the termux app package (com.termux), assuming its running when shell is started, like fortermux-float. This variable is included sincepidof com.termuxdoes not return anything for release builds. It does work for debug builds and over adb/root. However, you still won't be able to get additional process info withps, like that of threads, even with the pid and will need to use adb/root. However,kill $TERMUX_APP_PIDwill work fromtermux-appandtermux-float.These variables can be used by termux devs and users for custom logic in future depending on release type.
-
Add support for
~/.termux/termux.float.properties. (bc779d2f) -
! Convert
extra-keysto agnosticism by moving them totermux-sharedlibrary so that they can be imported and used by other apps for their own needs as long as they comply with GPLv3 license. Almost everything is customizable and has no dependency on termux specific logic. (2a74d43c) -
Add support for
SHIFTorSHFTextra-keys. Closes #1038. (2a74d43c,91172409) -
Add support for
PASTEextra-keysfor pasting text from clipboard. (7d76e8b1) -
Add support to long hold on
CTRL,ALT,SHIFTandFNto lock those control keys. They will not be released when you press another key and will only be released by pressing the respective control key again. Closes #2049, Closes #1861.2a74d43c) -
Add support for
com.termux.execute.background_custom_log_levelandcom.termux.RUN_COMMAND_BACKGROUND_CUSTOM_LOG_LEVEL. Check the commit and https://github.com/termux/termux-tasker#custom-log-level for details. (60f37bde,e889d84d,1259a212,197979fd) -
Add warning that hax support is not provided and asking questions will likely result in issue automatically closed or even ban. (
6409019a) -
Add warning reports with (partial) screenshots of error reports instead of text will likely be automatically closed/deleted. (
7047bbef) -
Add
termux-apilog level settings in termux app settings. (582e5693) -
Add
termux-floatlog level settings in termux app settings. (d55c1001) -
Add
termux-widgetlog level settings in termux app settings. (4953b126) -
Add
isTermuxAppInstalled()andisTermuxAppAccessible()functions toTermuxUtils. TheTermuxUtils.isTermuxAppInstalled()function can be used by external apps to check if termux app is installed and enabled. TheTermuxUtils.isTermuxAppAccessible()function can be used by termux plugin apps to check if termux app is installed, enabled, accessible as persharedUserIdandTERMUX_PREFIX_DIR_PATHis accessible and has read, write and execute permission. (e5c05489) -
Bootstrap error and report issue (optionally) will contain primary termux files
statinfo andlogcatdumpUsers have been reporting issues with bootstrap installation (and
loginfile access) failure on email and github but "most" have been useless since they don't follow instructions to debug the issue and report back. The real reason may depend on device. One could be that/data/data/com.termuxdoes not exist on the device in which case termux won't work on the device, at least without root. Other reasons could be wrong ownership or selinux context, selinux denials or attempting to install on external sd card (as reported by a user) where likely files dir was different from/data/data/com.termux/files.This commit will save dev and possibly user time and automatically generate the required info to debug such issues. The
lscommand will generatestatinfo for all the major termux directories and files so that existence or ownership issues can be shown. It will also runlogcatcommand to take a dump (last3000lines) in case other failures are being logged, like selinux denials as peravcentries. It will also show if app is installed on external sd card. This info will automatically be shown on bootstrap install failure report.Moreover, users can generate termux files
statinfo andlogcatdump manually too with terminal's long hold options menuMore->Report Issueoption and selectingYESin the prompt shown to add debug info. This can be helpful for reporting and debugging other issues. If the report generated is too large, thenSave To Fileoption in context menu (3 dots on top right) ofReportActivitycan be used and the file viewed/shared instead.Users must post complete report (optionally without sensitive info) when reporting issues, instead of (partial) screenshots which won't be accepted anymore.
There has been some design changes in android 11 for
/data/dataand/data/user/0directory. You can check javadoc forisTermuxFilesDirectoryAccessible()function inTermuxFileUtilsfor details.(
24ea83d6) -
! Added support to save reports to files and fixed large reports generating
TransactionTooLargeExceptionIf
ReportActivitywas started with a large report, i.e a few hundredKB, 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 aboveDataUtils.TRANSACTION_SIZE_LIMIT_IN_BYTES(100KB), it will be saved to a file in a cache directory/data/data/com.termux/cache/report_activityas a serialized object and loaded when activity is started. Now these large reports can't be copied or shared with other apps since that would again result inTransactionTooLargeExceptionexceptions andShareUtilsautomatically truncates the data (now from end) to100KBlength so that the exception doesn't occur. So now aSave To Fileoption has been added in context menu (3 dots on top right) ofReportActivityso that large or small reports can be saved to a file if needed. They will be save in root of/storage/emulated/0or 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 android11, 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 viaSAFfrom termux home is not something I wanna take on.Another issue is that
ReportActivityitself may not be able to show the entire report since Android may throwOutOfMemoryErrorexceptions if device memory is low. To solve this issue,ReportActivitywill truncate the report to1MBfrom 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 theSave To Fileoption and view the file in an external app or on pc that supports opening large files. TheQuickEditapp 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,
OutOfMemoryErrorexceptions 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 consume2-3times memory when saving. It's fun coding for android, right?The terminal transcript will not be truncated anymore that's generated via
Report Issueoption in terminal.(
351934a6) -
Add
TextIOActivityandTextIOInfo. TheTextIOActivitycan be used to edit or view text based on various config options defined byTextIOInfoand supportsmonospacefont and horizontal scrolling for editing scripts, etc. Current max text limit is95KB, which can be increased in future. (c3280a94) -
Add constants for launcher activities of termux plugins. (
5e2bec0f) -
Add
Theme.MaterialComponents.DayNight.TermuxPrimaryActivitytheme can be used by activities for day and night mode. (0bf4b1ec) -
! Support for delete intent for Notification.Builder in NotificationUtils. (
baacabdf)
Changed
-
! Only allow
ContentProvideraccess ifallow-external-appsis set to true. Thetermux-openandxdg-opencommands will now silently fail if value is not set totrue. An error notification will be added in future versions. The caller app likeQuickEditmay still show a flash error. Check https://github.com/termux/termux-tasker#allow-external-apps-property-optional on info on how to change the value. (dcedf394) -
Move to semantic versioning for app and library versions and add commit hash and
githubto APK file names and add support forTERMUX_APP_VERSION_NAMEandTERMUX_APK_VERSION_TAG,TERMUX_SPLIT_APKS_FOR_DEBUG_BUILDS,TERMUX_SPLIT_APKS_FOR_RELEASE_BUILDSenvironmental variable inapp/build.gradle. TheRELEASE_TAGvariable will not be used anymore since it may conflict with possibly other variables used by users. TheTERMUX_SPLIT_APKS_FOR_DEBUG_BUILDScan be set to0to disable building split APKs which may be helpful for users building termux on device considering they will extra space and build time. Instructions for building are at termux/termux-packages#7227 (comment).export TERMUX_SPLIT_APKS_FOR_DEBUG_BUILDS=0 ./gradlew assembleDebugThe APK will be found at
./app/build/outputs/apk/debug/termux-app_debug_universal.apkNote that F-Droid uses algorithm at https://gitlab.com/fdroid/fdroidserver/-/blob/2.1a0/fdroidserver/build.py#L746 to automatically detect built APKs, so ensure any modifications to location or file name are compliant. Auto updates are detected by
checkupdatesbot at https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py(
177fb048) -
Store
termux-widgettoken synchronously to theSharedPreferencesfile on creation. Attempt to solve termux/termux-widget#16. (4f66786b) -
! Do not wait for the user to press enter for failed terminal session commands if plugin expects the result back. (
c19e01fc) -
Make sure full path is included in
FileUtilsErrnos. (f00738fe) -
Disable
shrinkResourcesfor testing reproducible builds. (23b707a8) -
Ensure bootstrap installation creates prefix and prefix staging directory before extraction. (
4e5f2c7e) -
Ensure termux files directory is accessible before bootstrap installation and provide better info when running as secondary user/profile. Related issue #2168. (
6fa4b9b7) -
Add selinux context info to termux files info of debug output. (
f97f07df) -
Use multi-process SharedPrefernces for log level of plugin apps. Since termux-app runs in a separate process from other apps, if a user sets log level in termux settings, then it would require exiting the
termux-appcompletely since android cachesSharedPreferncesin memory and only writes to the file on app exit. Now updated value will be instantly written to the file so that plugins can directly read at startup. If plugins are already running, they would need to be restarted since usually log levels are loaded at startup. (9f1203f0) -
Drawerextra-keysbutton will toggle instead of just opening. (16c56a96) -
Renamed typo
TERMUX_ACTIVITY.ACTION_FAILSAFE_SESSIONtoTERMUX_ACTIVITY.EXTRA_FAILSAFE_SESSION. (b68a398f) -
Set default cursor color to white. (
4a74618f) -
Use millisecond timestamps for reports. (
98edf1fb) -
Add gemini to the list of url regex protocols. Implemented by @the-blank-x in #2217. (
cac9a769) -
Convert issue templates to forms. (
23d2c1f0) -
Bump bootstrap to
v2022.01.07-r1. (d37cd405) -
Update LICENSE.md. (
fefbf2ec)
Fixed
-
Fix
TermuxFileReceiverActivityincorrect handling of intent extras. Closes #2247. (5a8c4f10) -
Fix terminal cursor blinker not stopping when typing a character in non-gboard keyboards. (
8387b70f) -
Fix extra-keys shift key not uppercasing for all soft keyboards and added docs for keyboard key characters mapping. (
994df1c4) -
Ensure
FNextra key is read by the terminal. (d1478fb6) -
Use default values if
extra-keysorextra-keys-styletermux.propertiesvalues are empty. (fbb91149) -
Fix
NullPointerExceptionwhen running bell/vibrate on Samsung devices on android 8 and handled deprecated codeApparently occurs on only Samsung android 8 devices and there is no fix for vibrator except catching the exception so that app doesn't crash. (
956e20e5) -
Fix
Stdinvalue not being logged for background execution commands. (486faf7f) -
Prevent new plugin error or crash notifications overriding content of old ones. (
e7fc60af) -
Fix
RunCommandServicenotification not being cleared if an error was raised. (fabcc4fa) -
Fix issue where wrong IME inputType would be set if termux was returned to from another app with text input view mode selected. (
2b7aa5e8) -
Fix
extra-keysrepeatable input from getting stuck in some cases. Related issue #2156. (0308d6a6) -
Fix calculation of row number for selection and URL clicking. Implemented by @trygveaa in #2146. (
54bb83de) -
Ensure failsafe session can still be opened if files directory is not accessible and fix comment. (
a189f636) -
Fix bootstrap checksum check if it contained leading zeros. (
97af7943,32dcea72) -
Fix markdown link generation. (
8ee0c5a6) -
Fix permissions for
lib/apt/apt-helper. (1b62f7c9) -
Invert text color under block cursor. Implemented in #2228. Related issue #219. (
f65f384a,19c6134c) -
Revert "Changed: Bump compileSdkVersion to 31" commit
296ee60d. We do not need to bump tocompileSdkVersion31 currently, since I have decided not to bumpandroidx.windowto1.0.0-alpha10or higher currently, since it has changed APIs and ViewUtils will break. Moreover, bumping compileSdkVersion to 31 requires openjdk 11 in build environment, which will break Jitpack library build and possibly still F-Droid as well, unless changes are made. (c59835ed) -
Fix Discord badge. Implemented by @wmcbtech30 in #2199. (
1578ab55) -
Update urls to https. Implemented by @TotalCaesar659 in #2190. (
9a306ca1)