termux / termux-api

Termux add-on app which exposes device functionality as API to command line programs.
https://f-droid.org/en/packages/com.termux.api/
2.22k stars 442 forks source link

termux-dialog does not appear and hangs when run from termux shortcuts #557

Open crdoconnor opened 1 year ago

crdoconnor commented 1 year ago

Steps to reproduce:

  1. Create a script with just "termux-dialog" in it.
  2. Put it in the shortcuts folder and run from shortcuts app.
  3. The script then hangs. No dialog appears.

The script runs fine when run from within termux.

Output of termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=14642
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://grimler.se/termux/termux-x11 x11 main
Updatable packages:
bash/stable 5.2.2-1 aarch64 [upgradable from: 5.2.2]
termux-tools version:
1.29.3
Android version:
11
Kernel build information:
Linux localhost 4.14.186-g7c18952d3c68 #1 SMP PREEMPT Tue May 17 19:30:48 WIB 2022 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
Redmi Note 8 Pro

Logcat:

10-07 12:08:16.828 17070 17070 I Toast   : Show toast from OpPackageName:com.termux, PackageName:com.termux                         10-07 12:08:17.802 17070 17070 E libc    : Access denied finding property "ro.vendor.pref_scale_resolution"
10-07 12:08:17.802 17070 17070 E libc    : Access denied finding property "ro.vendor.pref_scale_resolution"                         10-07 12:08:18.802 17070 17070 D View    : [Warning] assignParent to null: this = android.widget.LinearLayout{c8a323d V.E...... ......ID 0,0-386,316}                                                 10-07 12:08:18.809 17070 17070 I InputTransport: Destroy ARC handle: 0x7bb32d20c0                                                   10-07 12:08:19.986 17070 17070 V ViewRootImpl[TermuxActivity]: [ANR Warning]Input routeing takes more than 6000ms since 1970-01-01 01:00:00.000, this = com.mediatek.view.impl.ViewDebugManagerImpl@7085ea9
10-07 12:08:19.987 17070 17070 V ViewRootImpl[TermuxActivity]: Input event delivered to android.view.ViewRootImpl$SyntheticInputStage@decb539 at 2022-10-07 12:08:19.985                              10-07 12:08:19.987 17070 17070 V ViewRootImpl[TermuxActivity]: Input event delivered to android.view.ViewRootImpl$EarlyPostImeInputStage@a542a32 at 2022-10-07 12:08:19.984
10-07 12:08:19.987 17070 17070 V ViewRoo
HusniMuhammad commented 1 year ago

you can use termux-notification quick-reply feature

termux-notification --button1 "Answer" --button1-action "termux-toast \$REPLY"

If you're click reply button. The termux-toast will be appeared according to the command

Screenshot_20230906-172956

For more information about termux-notification

termux-notification -h

information about actions eg: --button1-action

termux-notification --help-actions

If it's works please close this issue