Use black or white cursor color based on terminal background instead of always white if colors.properties didn't have cursor color set. Credit for algorithm link belong to @Jamie-Landeg-Jones. Closes #2653. (160ab68e)
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
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_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.
! 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 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)
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/shar...
Fix issue where a colour tint/highlight would be added to the terminal. This would happen when soft keyboard was to be disabled or hidden at startup and a hardware keyboard was attached and user started typing on hardware keyboard without tapping on the terminal first. (c6b4114)
Jitpack library publishing failed for initial v0.115 release so 886e52d was done to fix it and v0.115 was re-released but jitpack kept building pre-fix initial release as per commit Date in build.log, likely due to one time download. So releasing v0.116 so that it gets picked up. Users can import library based on entries like the following. The one mentioned in b7b12eb are invalid.
Note that the first time someone imports a new version, it will take some time to build and you may get errors like Unable to resolve dependency for ':app@debug/compileClasspath'. It will take a few minutes for builds to be downloadable even after build.log shows them to have succeeded, run Sync Project with Gradle Files again to try to redownload. You can check builds and their logs at -app and the API at e.g -app/master-SNAPSHOT.
Add support to send back or store RUN_COMMAND intent command results in files and provide way to fix argument splitting sent with am command caused by commas , in arguments itself. Native support has been added inside termux to store results of both foreground and background commands inside files, that also sends back internal errmsgs as long as result files extras are valid. This can be used to run synchronous commands from inside termux, with other apps that have Run commands in Termux environment (com.termux.permission.RUN_COMMAND) like Tasker, from pc over adb or inside adb shell if you have a rooted device, or from pc if you have setup termux sshd. The RUN_COMMAND intent can only be sent by the termux user itself, by an app that has the permission or by the root user. The shell user of adb cannot send it. A script will be provided at a later time that will automatically detect these cases to easily run RUN_COMMAND intent commands which will also automatically create temp directories and do cleanup. This can also be useful inside termux itself, like if you want to start a new foreground session and to automatically store its output to a log file when you exit. Support can also be added for this to be done for termux-boot and termux-widget as well but will require updates for them. Check the commit message for full details and examples for this since too long to be added here. (2aafcf8)
Allow users to disable terminal margin adjustment. The user can add disable-terminal-margin-adjustment=true entry to termux.properties file to disable terminal view margin adjustment that is done to prevent soft keyboard from covering bottom part of terminal view on some devices. Margin adjustment may cause screen flickering on some devices and so should be disabled. The default value is false. So adding the entry disable-terminal-margin-adjustment=true to termux.properties file will disable margin adjustment. Exit termux and restart for changes to take affect after updating value. In case e5a9b99 did not fix screen flickering issues for #2127, then this can be used to disable it. Closes #2127.
Show crash notification when bootstrap installation or setup storage failures. Sometimes users report that bootstrap installation failed on their devices but provide no details. Since they don't check logcat for the exception or exception is one time only, we can't know what happened. Although, reasons are likely root ownership files. The notification will show the full stacktrace including suppressed ones for why failure occurred and hopefully be easier to find the problems and we can get reports too. (e408fdc)
Move from github packages to for hosting termux library packages. Github Package hosting is considered a private repository since it requires github APIs keys if a hosted library needs to be imported as a dependency. Importing from private repositories is not allowed as per F-Droid policy so termux plugin apps can't import termux libraries as dependencies so hence we move to Jitpack. Usage details for importing termux libraries in your own app as dependencies are in the commit message. (b7b12eb, 69e5dee, 886e52d)
Change license for non-termux utils from GPLv3 to MIT so that they can be used by other termux plugin apps or apps that may be released under a different license. Termux is already using a lot of libraries that are not GPL and such general utils shouldn't be restrictive anyways. Moreover, TermuxConstants and TermuxPropertyConstants should be MIT licensed as well so that other non-FOSS or non-GPLv3 apps can use them, like for RUN_COMMAND intent. Any code not listed in exceptions of LICENSE.md files is still under GPLv3, mainly termux specific code and it will and should remain that way. All code in files whose license is changed was authored by me (@agnostic-apollo) as far as I can tell, but if any code in them is not that I missed, let me know, so that changes can be made since I can't and won't change the license of code authored by someone else. If some other objection is raised, let me know too. Future contributors should check the LICENSE.md files and see if they are okay with contributing code as MIT and if they are not, then they should create separate file/package in termux-shared. Check termux-app/LICENSE.md and termux-app/termux-shared/LICENSE.md for exceptions. (70e1acc, 4926516)
687b7eae2f