termux / termux/termux-api

1-minute delay/wait time/hang on some Termux:API-related commands. Initialization time?

Open
#714 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.3k
Forks
920
PR merge metrics
No merged PRs in 30d

Description

Problem description
Some commands, or commands used the first time in a while, have precisely 1-minute delay between the time you sent them and a command execution.

For example, for adb there's a one-minute gap after plugging in a device and having it show in termux-adb. For termux-fastboot, any termux-fastboot command will take a minute to execute. First time executing termx-toast {message} takes a minute.

Observed with:

  • termux-adb (doesn't show device one minute. And it's definitely Termux:API issue)
  • termux-fastboot (one minute wait for every command. And it's definitely Termux:API issue)
  • termux-location (one minute wait for every command)
  • termux-toast (not consistent)

Steps to reproduce
For my use case its termux-adb: https://github.com/nohajc/termux-adb (No, the issue IS NOT on termux-adb side)

To reproduce (with my use case)

  1. Install termux-adb
  2. Plug any phone into your phone
  3. Run termux-adb devices and see how the whole nothing happened and there's no connected devices
  4. Wait for a roughly 1 minute, check termux-adb devices and behold how the device has randomly appeared

Scenario №2 (still with termux-adb):

  1. Plug any phone in yours
  2. Run termux-fastboot devices and observe how the whole nothing happens for a minute (the other device doesn't even have to be in fastboot)

Scenario №3:

  1. Open Termux with termux-api and Termux:API app installed, but with no commands executed before. It has to be some time, terminating Termux:API or Termux doesn't cause it.
  2. Execute termux-toast hello, it should take exactly one minute to give the toast

Scenario №4:

  1. Just execute termux-location and wait a minute (precisely) for nothing

Expected behavior
Commands shouldn't take a minute to execute

Additional information

  • termux-api application version: 0.50.1
  • termux-api package version (installed through apt): 0.58.0-1
  • Android OS version: 14
  • Device model: Ulefone Armor 21, but I've seen other people with the same issue on other devices.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the delay with termux-adb, termux-fastboot, termux-location, and termux-toast on the reported Android setup, then trace the Termux:API request path. Done means identifying and removing the consistent one-minute wait while preserving command behavior across these entry points.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
api, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.