Skip to content

v0.118.0

Compare
Choose a tag to compare
@agnostic-apollo agnostic-apollo released this 07 Jan 22:35
· 291 commits to master since this release

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=true entry to termux.properties file to enable opening of URL links in terminal transcript when clicked or tapped. The default value is false. Running termux-reload-settings command 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=false entry to termux.properties file to disable auto capitalization of extra keys text for both normal and popup buttons. The default value is true. Running termux-reload-settings command will also update the behaviour instantaneously if changed. (5c72c3ca)

  • Allow users to adjust terminal horizontal and vertical margin. The terminal-margin-horizontal key can be used to adjust the terminal left/right margin and the terminal-margin-vertical can be used to adjust the terminal top/bottom margin. This will also affect drawer. The user can set an integer value between 0 and 100 as dp units. The default value is still 3 for horizontal and 0 for vertical margin. So adding an entry like terminal-margin-horizontal=10 to termux.properties file will allow users to set a horizontal margin of 10dp. After updating the value, either restart termux or run termux-reload-settings for 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 10dp may be helpful with peek-and-slide for people having gesture navigation enabled on android 10+ 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=true entry to termux.properties file to disable hardware keyboard shortcuts. The default value is false. Running termux-reload-settings command will also update the behaviour instantaneously if changed. Note that for ctrl+alt+p to work, you need to unset shortcut.rename-session = ctrl + n. https://wiki.termux.com/wiki/Terminal_Settings. Closes #1825. (829cc398, fcc0d362)

  • Request android.permission.PACKAGE_USAGE_STATS permission. The permission can be granted from Android Settings -> System -> Usage Access. Closes #2269. (865f29d4)

  • Add TERMUX_API_VERSION to termux shell environment. This can be used to check if Termux:API is installed and enabled for cases where users try to run termux-api commands and it hangs. (0cf3cef7)

  • Add TERMUX_IS_DEBUGGABLE_BUILD, TERMUX_APK_RELEASE and TERMUX_APP_PID to termux shell environment.

    The TERMUX_IS_DEBUGGABLE_BUILD env variable will be set to 1 if termux APK is a debuggable APK and 0 otherwise. Note that the dev_keystore.jks shipped 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 be 0.

    The TERMUX_APK_RELEASE will be set to GITHUB, F_DROID or GOOGLE_PLAY_STORE depending on release type. It will be set to UNKNOWN if signed with a custom key.

    The TERMUX_APP_PID will 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 for termux-float. This variable is included since pidof com.termux does 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 with ps, like that of threads, even with the pid and will need to use adb/root. However, kill $TERMUX_APP_PID will work from termux-app and termux-float.

    These variables can be used by termux devs and users for custom logic in future depending on release type.

    (da07826a, 7b10a35f)

  • Add support for ~/.termux/termux.float.properties. (bc779d2f)

  • ! Convert extra-keys to agnosticism by moving them to termux-shared library 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 SHIFT or SHFT extra-keys. Closes #1038. (2a74d43c, 91172409)

  • Add support for PASTE extra-keys for pasting text from clipboard. (7d76e8b1)

  • Add support to long hold on CTRL, ALT, SHIFT and FN to 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_level and com.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-api log level settings in termux app settings. (582e5693)

  • Add termux-float log level settings in termux app settings. (d55c1001)

  • Add termux-widget log level settings in termux app settings. (4953b126)

  • Add isTermuxAppInstalled() and isTermuxAppAccessible() functions to TermuxUtils. The TermuxUtils.isTermuxAppInstalled() function can be used by external apps to check if termux app is installed and enabled. The TermuxUtils.isTermuxAppAccessible() function can be used by termux plugin apps to check if termux app is installed, enabled, accessible as per sharedUserId and TERMUX_PREFIX_DIR_PATH is accessible and has read, write and execute permission. (e5c05489)

  • Bootstrap error and report issue (optionally) will contain primary termux files stat info and logcat dump

    Users have been reporting issues with bootstrap installation (and login file 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.termux does 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 ls command will generate stat info for all the major termux directories and files so that existence or ownership issues can be shown. It will also run logcat command to take a dump (last 3000 lines) in case other failures are being logged, like selinux denials as per avc entries. 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 stat info and logcat dump manually 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, instead of (partial) screenshots which won't be accepted anymore.

    There has been some design changes in android 11 for /data/data and /data/user/0 directory. You can check javadoc for isTermuxFilesDirectoryAccessible() function in TermuxFileUtils for details.

    (24ea83d6)

  • ! Added support to save reports to files and fixed large reports generating TransactionTooLargeException

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

    (351934a6)

  • Add TextIOActivity and TextIOInfo. The TextIOActivity can be used to edit or view text based on various config options defined by TextIOInfo and supports monospace font and horizontal scrolling for editing scripts, etc. Current max text limit is 95KB, which can be increased in future. (c3280a94)

  • Add constants for launcher activities of termux plugins. (5e2bec0f)

  • Add Theme.MaterialComponents.DayNight.TermuxPrimaryActivity theme can be used by activities for day and night mode. (0bf4b1ec)

  • ! Support for delete intent for Notification.Builder in NotificationUtils. (baacabdf)

Changed

  • ! Only allow ContentProvider access if allow-external-apps is set to true. The termux-open and xdg-open commands will now silently fail if value is not set to true. An error notification will be added in future versions. The caller app like QuickEdit may 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 github to APK file names and add support for TERMUX_APP_VERSION_NAME and TERMUX_APK_VERSION_TAG, TERMUX_SPLIT_APKS_FOR_DEBUG_BUILDS, TERMUX_SPLIT_APKS_FOR_RELEASE_BUILDS environmental variable in app/build.gradle. The RELEASE_TAG variable will not be used anymore since it may conflict with possibly other variables used by users. The TERMUX_SPLIT_APKS_FOR_DEBUG_BUILDS can be set to 0 to 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 assembleDebug  
    

    The APK will be found at ./app/build/outputs/apk/debug/termux-app_debug_universal.apk

    Note 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 checkupdates bot at https://gitlab.com/fdroid/fdroidserver/-/blob/master/fdroidserver/checkupdates.py

    (177fb048)

  • Store termux-widget token synchronously to the SharedPreferences file 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 shrinkResources for 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-app completely since android caches SharedPrefernces in 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)

  • Drawer extra-keys button will toggle instead of just opening. (16c56a96)

  • Renamed typo TERMUX_ACTIVITY.ACTION_FAILSAFE_SESSION to TERMUX_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 TermuxFileReceiverActivity incorrect 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 FN extra key is read by the terminal. (d1478fb6)

  • Use default values if extra-keys or extra-keys-style termux.properties values are empty. (fbb91149)

  • Fix NullPointerException when running bell/vibrate on Samsung devices on android 8 and handled deprecated code

    Apparently 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 Stdin value not being logged for background execution commands. (486faf7f)

  • Prevent new plugin error or crash notifications overriding content of old ones. (e7fc60af)

  • Fix RunCommandService notification 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-keys repeatable 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 to compileSdkVersion 31 currently, since I have decided not to bump androidx.window to 1.0.0-alpha10 or 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)