这是indexloc提供的服务,不要输入任何密码
Skip to content

termux-notification does not work in background scripts (i.e., those in $HOME/.shortcuts/tasks) #1925

@bdantas

Description

@bdantas

termux-notification works if script is in /data/data/com.termux/files/home/.shortcuts/ but does not work if script is in /data/data/com.termux/files/home/.shortcuts/tasks/

Steps to reproduce

  1. Create this script as /data/data/com.termux/files/home/.shortcuts/tester:
#!/bin/sh
termux-notification
  1. Create a Termux shortcut widget for tester on phone's home screen. Launching the widget produces a notification.
  2. Move the script to /data/data/com.termux/files/home/.shortcuts/tasks/tester
  3. Delete the Termux shortcut widget for tester and re-create it using the new path. Launching the widget does not produce a notification.

Expected behavior
A shell script should be able to create a notification using termux-notification regardless of whether the script is running in a terminal or running in the background.

Additional information

  • Termux application version: 0.104
  • Termux API version: 0.47
  • Android OS version: LineageOS 16
  • Device model: OnePlus 5

I already tried comparing the environment of terminal vs. background (by redirecting output of env to a log file) and did not find an obvious culprit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions