-
Notifications
You must be signed in to change notification settings - Fork 657
Open
Description
Problem description
About problem
When run from a script, the termux-vibrate command terminates according to the shell/interpreter, but it can still block the terminal and corrupt pipes and standard streams for other commands executed afterwards. I did not notice this behavior on Android 13/14, but it appears on Android 15/16. As an example, in my implementation, running jq after termux-vibrate produces corrupted output.
Examples
The attached screenshots show, in order, the output using termux-vibrate -d 50 as the vibration engine (between output records), and in the second one the same output using echo -en "\a" (bell).
Steps to reproduce
Example Bash script to reproduce:
#!/data/data/com.termux/files/usr/bin/bash
while true; do
raw=`termux-wifi-scaninfo 2>/dev/null || true`
[ -z "$raw" ] && return 1
printf "%s" "$raw" | jq -c '.[] | {ssid:.ssid,bssid:.bssid,rssi:.rssi,frequency_mhz:.frequency_mhz,capabilities:.capabilities}' | while IFS= read -r line; do
ssid=$(printf "%s" "$line" | jq -r '.ssid')
bssid=$(printf "%s" "$line" | jq -r '.bssid')
rssi=$(printf "%s" "$line" | jq -r '.rssi')
freq=$(printf "%s" "$line" | jq -r '.frequency_mhz')
caps=$(printf "%s" "$line" | jq -r '.capabilities')
echo "$ssid" "$bssid" "$rssi" "$freq" "$caps"
case $1 in
bell) echo -en "\a" ;;
vibrate) termux-vibrate -d 50 ;;
esac
done
done
How to use:
- Run the script.
- If no parameter is given, everything works fine.
- If the parameter bell is used, everything works fine.
- If the parameter vibrate triggers
termux-vibrate, the terminal may block and subsequent commands likejqproduce corrupted output.
Expected behavior
termux-vibrate should execute the vibration without interfering with the terminal, pipes, or standard streams of other commands, regardless of Android version.
Additional information
- termux-api application version: 0.53.0
- termux-api package version (installed through apt): 0.59.1-1
- Android OS version: 15/16
- Device model: Nubia NX769J/NX809J
Metadata
Metadata
Assignees
Labels
No labels