termux / termux/termux-api-package

`termux-api` command should detect if Termux:API plugin is not installed and print error.

Open
#200 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
1.7k
Forks
523
PR merge metrics
No merged PRs in 30d

Description

Feature description
You can invoke command like echo $(pm path com.termux.api 2>&1 </dev/null) in termux to get termux:api plugin apk path or get error otherwise, it should be usable to detect plugin installation even without PackageManager API (or JVM).

Background information
Termux:X11 companion package can detect if main APK is installed or not via PackageManager API. Termux:API should do that too.
There are enough people coming to discord, matrix and reddit complaining about termux-api-based commands are hanging indefinitely.

Redirecting everything to /dev/null or anonymous pipes is necessary in command echo $(pm path com.termux.api 2>&1 </dev/null), the same applies to the case if you are porting it to C.

Related to:
https://github.com/termux/termux-api-package/issues/138
https://github.com/termux/termux-api-package/issues/153
https://github.com/termux/termux-api-package/issues/80

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

The issue names the termux-api command and the pm path com.termux.api check; start by locating that command's implementation and reviewing how it invokes the plugin. Done means the command reports a clear error when the plugin is absent, succeeds when installed, and does not hang; exercise both cases while suppressing command output as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, shell
Domain
cli, mobile-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.