gesture upstream rebase 2024 08 17#5
Closed
craigcomstock wants to merge 896 commits intomasterfrom
Closed
Conversation
…it since termux-shared is growing too big and layers are getting out of hand
…app or com.termux.shared.termux package
…T_LOG_TAG at application startup Plugin apps must do the same
…s in TermuxActivity
…ested via Service context
…ns in TermuxService
…and breaks logcat command filterspecs argument
…t libraries can use it directly without having to load or get it from termux properties
…minal character java.lang.ArrayIndexOutOfBoundsException: length=64; index=-1 at com.termux.terminal.TerminalRow.setChar(TerminalRow.java:127) at com.termux.terminal.TerminalBuffer.setChar(TerminalBuffer.java:413) at com.termux.terminal.TerminalEmulator.emitCodePoint(TerminalEmulator.java:2329) at com.termux.terminal.TerminalEmulator.processCodePoint(TerminalEmulator.java:617) at com.termux.terminal.TerminalEmulator.processByte(TerminalEmulator.java:513) at com.termux.terminal.TerminalEmulator.append(TerminalEmulator.java:480) at com.termux.terminal.TerminalSession$MainThreadHandler.handleMessage(TerminalSession.java:339) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:219) at android.app.ActivityThread.main(ActivityThread.java:8349) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
java.lang.RuntimeException: Unable to resume activity {com.termux/com.termux.app.TermuxActivity}: android.content.res.Resources$NotFoundException: File res/raw/bell.ogg from drawable resource ID #0x7f0f0001
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3480)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3520)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1554)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6247)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
Caused by: android.content.res.Resources$NotFoundException: File res/raw/bell.ogg from drawable resource ID #0x7f0f0001
at android.content.res.ResourcesImpl.openRawResourceFd(ResourcesImpl.java:308)
at android.content.res.Resources.openRawResourceFd(Resources.java:1272)
at android.media.SoundPool.load(SoundPool.java:247)
at com.termux.app.terminal.TermuxTerminalSessionClient.getBellSoundPool(TermuxTerminalSessionClient.java:257)
at com.termux.app.terminal.TermuxTerminalSessionClient.onResume(TermuxTerminalSessionClient.java:82)
at com.termux.app.TermuxActivity.onResume(TermuxActivity.java:290)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
at android.app.Activity.performResume(Activity.java:6861)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3457)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3520)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1554)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6247)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
at android.content.res.AssetManager.openNonAssetFdNative(Native Method)
at android.content.res.AssetManager.openNonAssetFd(AssetManager.java:467)
at android.content.res.ResourcesImpl.openRawResourceFd(ResourcesImpl.java:306)
at android.content.res.Resources.openRawResourceFd(Resources.java:1272)
at android.media.SoundPool.load(SoundPool.java:247)
at com.termux.app.terminal.TermuxTerminalSessionClient.getBellSoundPool(TermuxTerminalSessionClient.java:257)
at com.termux.app.terminal.TermuxTerminalSessionClient.onResume(TermuxTerminalSessionClient.java:82)
at com.termux.app.TermuxActivity.onResume(TermuxActivity.java:290)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1270)
at android.app.Activity.performResume(Activity.java:6861)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3457)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3520)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1554)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6247)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:107)
…OM_LOG_LEVEL was not passed
… to set an alarm or timer in an alarm clock app - https://developer.android.com/reference/android/Manifest.permission#SET_ALARM - https://developer.android.com/reference/android/provider/AlarmClock Closes termux#3990
Currently the Termux terminal emulator prints "HI" in red with: ```sh printf "\e[31;m HI \e[0m" ``` This is not how other terminals (tested on xterm, gnome-terminal, alacritty and the mac built in terminal) handle it, since they parse ""\e[31;m" as "\e[31;0m", where the "0" resets the colors. This change aligns with other terminals, as well as improves performance by avoiding allocating a new int[] array for each byte processed by `parseArg()`, and most importantly simplifies things by removing the `mIsCSIStart` and `mLastCSIArg` state, preparing for supporting ':' separated sub parameters such as used in https://sw.kovidgoyal.net/kitty/underlines/
In other terminals, such as gnome-terminal, Shift-PgUp and Shift-PgDn scroll the screen by a full page, rather than a single line. Adjust termux to match.
… everything needed, mostly works on square android watch!
…wn gestures for font increase/decrease since we took away ability to pinch zoom in terminal view
… so updates going the wrong place
…ar sessions maybe
…ich seems to work
…t out responsiveness that I fixed with an interstitial activity
…ing java.io.File.path accessible
…ng why I added them, scroll problems maybe, or layers
craigcomstock
pushed a commit
that referenced
this pull request
Nov 11, 2025
…`6.1` to fix crash on Android 16 QPR1
```
Build fingerprint: 'google/shiba_beta/shiba:16/BP31.250502.008/13497110:user/release-keys'
Revision: 'MP1.0'
ABI: 'arm64'
Executable: /system/bin/app_process64
Cmdline: com.termux
pid: 22617, tid: 22617, name: com.termux >>> com.termux <<<
uid: 10323
tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE)
pac_enabled_keys: 000000000000000f (PR_PAC_APIAKEY, PR_PAC_APIBKEY, PR_PAC_APDAKEY, PR_PAC_APDBKEY)
esr: 0000000092000006 (Data Abort Exception 0x24)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x000000000000000c
Cause: null pointer dereference
x0 0000000070b6f798 x1 0000000002159228 x2 000000000000000c x3 00000000ebad6073
x4 00000000ebad6074 x5 00000000ebad6075 x6 00000000ebad6076 x7 00000000ebad6077
x8 00000000ebad6078 x9 00000000ebad6079 x10 00000000ebad607a x11 00000000ebad607b
x12 00000000ebad607c x13 00000000ebad607d x14 00000000ebad607e x15 00000000ebad607f
x16 0000007feda203f0 x17 0000007976776a9c x18 0000007cd0e44000 x19 b400007b850b8be0
x20 0000000000000000 x21 b400007b850b8ca0 x22 0000000000000000 x23 00000000021592b8
x24 000000006413b378 x25 0000000070b99ee0 x26 0000000070b9fc78 x27 0000000000000000
x28 0000000000000053 x29 0000000070b99ee0
lr 0000007976776a98 sp 0000007feda203f0 pc 0000007976776b0c pst 0000000080001000
esr 0000000092000006
26 total frames
backtrace:
#00 pc 00000000000c8b0c /data/app/~~p_sHRwZKj3QVf_xeRMrR3g==/com.termux-rodTRD4IY6G2qtCPCrHfhw==/oat/arm64/base.odex (org.lsposed.hiddenapibypass.HiddenApiBypass.getDeclaredMethods+780)
#1 pc 00000000000c8dc4 /data/app/~~p_sHRwZKj3QVf_xeRMrR3g==/com.termux-rodTRD4IY6G2qtCPCrHfhw==/oat/arm64/base.odex (org.lsposed.hiddenapibypass.HiddenApiBypass.setHiddenApiExemptions+68)
#2 pc 00000000000ae560 /data/app/~~p_sHRwZKj3QVf_xeRMrR3g==/com.termux-rodTRD4IY6G2qtCPCrHfhw==/oat/arm64/base.odex (com.termux.shared.reflection.ReflectionUtils.bypassHiddenAPIReflectionRestrictions+448)
#3 pc 00000000000a342c /data/app/~~p_sHRwZKj3QVf_xeRMrR3g==/com.termux-rodTRD4IY6G2qtCPCrHfhw==/oat/arm64/base.odex (com.termux.shared.android.SELinuxUtils.getContext+108)
#4 pc 00000000000c0b60 /data/app/~~p_sHRwZKj3QVf_xeRMrR3g==/com.termux-rodTRD4IY6G2qtCPCrHfhw==/oat/arm64/base.odex (com.termux.shared.termux.shell.command.environment.TermuxAppShellEnvironment.setTermuxAppEnvironment+3216)
#5 pc 000000000009eafc /data/app/~~p_sHRwZKj3QVf_xeRMrR3g==/com.termux-rodTRD4IY6G2qtCPCrHfhw==/oat/arm64/base.odex (com.termux.app.TermuxApplication.onCreate+1596)
...
termux#22 pc 0000000000105c98 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+104) (BuildId: ea93df5e792bbd2e0cbb71b2a7599aaa)
termux#23 pc 000000000013121c /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+908) (BuildId: ea93df5e792bbd2e0cbb71b2a7599aaa)
termux#24 pc 000000000000459c /system/bin/app_process64 (main+1212) (BuildId: a237cfae6965d7f0b950e5955c73432c)
termux#25 pc 000000000006bb88 /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+120) (BuildId: eecb0fc2ec8128ec92c091c0160586d1)
```
Related commit LSPosed/AndroidHiddenApiBypass@9efadf06
Related commit https://android-review.googlesource.com/c/platform/libcore/+/3380841
Related commit https://cs.android.com/android/_/android/platform/libcore/+/0dc31afe
Closes termux#4556
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TermuxConstantsclass to store all shared constants of Termux app and its pluginsTermuxConstantsclass has been updated tov0.19.0. Check its Changelog section for info on changes.PASTEextra key for pasting text from clipboardSHIFTorSHFTFNextra key is read by the terminalTERMUX_ACTIVITY.ACTION_FAILSAFE_SESSIONtoTERMUX_ACTIVITY.EXTRA_FAILSAFE_SESSIONgithubto APK file namesuse-black-uitermux property and replace it withnight-modePermissionUtils.requestPermissions()not requesting multiple permissions correctlyMANAGE_EXTERNAL_STORAGEpermission and callEnvironment.isExternalStorageManager()TERMUX_API_APT_*constantsTermuxUtils.getAppInfoMarkdownString()is a plugin appTermuxUtils.getAppInfoMarkdownString()TermuxAppSharedPreferencessince plugin apps may need to read values modified by termux app processonPreLogCrash()andonPostLogCrash()inCrashHandlerso thatCrashHandlerClientcan decide which exceptions to log and add custom logiccom.termux.app.utils.CrashUtilstocom.termux.shared.termux.crash.TermuxCrashUtilsso that plugins trigger plugin notifications tooACTION_NOTIFY_APP_CRASHin receiver registered byTermuxActivityto notify users of plugin app crashesTermuxActivityis resumed instead of only on app startupShareUtils~/storagesymlinks fordocuments,podcastsandaudiobooksmedia-*symlinks toAndroid/mediafor all storages andexternal-0symlink toAndroid/mediaof primary storage$TMPDIRclear mechanism on termux exitSettings.ACTION_*permission requests result callbackExecutionCommand.sessionNamein addition toTerminalSession.mSessionNameRUN_COMMANDintentcom.termux.app.utils.PluginUtilstocom.termux.shared.termux.plugins.TermuxPluginUtilsTermuxCrashUtilssendPluginCrashReportNotification() tosendCrashReportNotification()`ExecutionCommandgetArgumentsLogString()andgetArgumentsMarkdownString()functions for external usageUncaughtExceptionHandlerimplemented byCrashHandlerreceives an exception on a non main threadCrashHandleras theUncaughtExceptionHandlerDataUtilsto get generic, space and tab indented stringsFileUtils.deleteFile()in addition to allowed file typesFileType.SOCKETsupport and addFileUtils.deleteSocketFile()functionObjectclass object to be passed toReflectionUtils.invokeField()Logger.logErrorPrivate*()functions which do not log errors that may contain potentially private info unless log level is debug or higherTERMUX_APPS_DIR_PATHandTERMUX_APP.APPS_DIR_PATHand create them at application startup.UserUtilsto get user name for user id fromPackageManagerandLibcoreProcessUtilsto get app process name for a pid fromActivityManagertermux-amserverTERMUX_APP_PACKAGE_MANAGERandTERMUX_APP_PACKAGE_VARIANTto build APKs with different package manager configurationsminSdkVersionfrom24to21to restart supporting android 5/6 for the time beingtermux-am-libraryto 2.0.0 that usesminSdkVersion21ViewUtils.dpToPx()to not lose precisionViewUtils.pxToDp()minSdkVerion21TermuxNotificationUtils.getTermuxOrPluginAppNotificationBuilder()helper function and fix notification icon drawable resource id issue on Android 5UnsatisfiedLinkErrorforlocal-socketlibraryTERMUX_PACKAGE_VARIANTapt-android-5buildsapt-android-5variant instead of on Android 5/6< 24since NotificationManager.IMPORTANCE_HIGH requires API 24Settings.ACTION_*permission requests for non-activity contextsTERMUX_APP.APPS_DIR_PATHbasename fromtermux-apptocom.termuxSESSION_NAMEandSESSION_CREATE_MODEtoSHELL_NAMEandSHELL_CREATE_MODEand add support forShellCreateModetoAppShellsAppShellexecutable is notnullbefore trying to execute itTermuxSessionexecutable isnullif its empty so thatloginshell can startSELinuxUtilsto get process and file paths security contextsPackageUtilsto getseInfoandseInfoUserof packagePackageUtilsto get base APK path of packageAPK_PATH,SE_PROCESS_CONTEXT,SE_FILE_CONTEXTandSE_INFOwhen generating app info markdown stringfileword inFileUtils.copyOrMoveFile()MITlicensed shell environment clientTermuxShellManagerto manage all termux app wide shellsAppShellandTermuxSessionfor caller to add/override additional environment variables not added byIShellEnvironment.setupShellCommandEnvironment()ExecutionCommandsnot managed byTermuxShellManagershould haveid-1UnixShellEnvironment.LOGIN_SHELL_BINARIESvariable for common/supported login shell binaries searched and addfishandshshell as additional backupsTermuxAppShellEnvironmentandTermuxAPIShellEnvironmentto exportTermuxandTermux:APIapp variables inTermuxShellEnvironmentTERMUX_APP__AM_SOCKET_SERVER_ENABLEDenvironment variable value iftermux-am-socketserver state changesShellCommandShellEnvironmentandTermuxShellCommandShellEnvironmentto exportExecutionCommandvariablesTermuxShellEnvironmentat app startup/data/data/com.termux/files/usr/etc/termux/termux.envon app startup and package changesSettingsProviderUtilsto getSettingglobal, secure and system namespace valuesPhantomProcessUtilsto get phantom processes related settings valuesMAX_PHANTOM_PROCESSESandDEVICE_CONFIG_SYNC_DISABLEDvalue to device info output like shown in Termux About pageTermuxTerminalSessionServiceClientand renamedTermuxTerminalSessionClienttoTermuxTerminalSessionActivityClientExecutionCommand.pidnot being set for first and background terminal sessions sinceTermuxTerminalSessionClientBasewas still being used instead ofTermuxTerminalSessionActivityClientPackageUtils.setComponentState();or have sequential;characters9999as per vt510termux.propertiesreload not working if the properties file didn't exist at app startupSCROLLextra key to toggle auto scrolling of terminal to bottom on terminal text updates and termux activity returnAppSharedPreferencesto holdSharedPreferencesof apps and inherit termux app prefrences from itShareUtilsto copy and paste text and prevent potentialNPEShare selected textof terminal in long holdMOREmenu so that users don't have to copy and paste to move text between appsKEY_LAST_PENDING_INTENT_REQUEST_CODEtoTermuxAPIAppSharedPreferencesPGUPandPGDNextra keys to repetitive keys so that long holding them triggers page scrolling instead of having to repeatedly press the key to change pagesSHIFT+PAGE_UPandSHIFT+PAGE_DOWNbehaviour to scroll1line of scrollback history instead of scrolling command history or changing pagesDocsas a valid typeTwittertoX (Twitter)in READMESET_ALARMpermission to allow broadcasting an intent to set an alarm or timer in an alarm clock appgithub-releases/**branches