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.34k stars 459 forks source link

Stop `termux-notification --button1-action` previous execution overwrite #711

Open Benjamin-Loison opened 1 month ago

Benjamin-Loison commented 1 month ago

https://github.com/termux/termux-api/commit/3bea194249586a7dcb143e66b46c1694cb6ca21a#diff-343e04246aa27ee11598690b750ef754846d37f1107456982925ae4526689ce7 introduces the issue.

Last commit has the issue:

https://github.com/user-attachments/assets/b1bfceb9-9f95-4839-87d1-beb56a132dab

While this pull requests solves the issue by restoring v0.50.1 behavior:

https://github.com/user-attachments/assets/7c5febae-35c0-442d-96cb-3f9f59cce271

Bash function used:

notification-test() {
    termux-notification -t "Test $1" --button1 "Button $1" --button1-action "echo Button $1 >> termux_notification_action.txt"
}
notification-test 0

Tested on Fairphone 4 LineageOS 21 with Termux app c2d57f2ed810b6fa854a6c9ab0ecee4aac38a0cc.

More details at Benjamin-Loison/termux-api/issues/23.