termux / termux/termux-api

Termux-location not working via bash

Open
#226 7 comments 0 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

Using termux-location at the command line (interactively) works fine. But when I put commands into a bash file, I get no output or null.

For example, bash code in a file like this -

x=$(termux-location -p network)
x=$(echo $x | jq .text)
echo $x

Works correctly interactively, but does not work when running in bash file with proper shebang. Any ideas?

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 comparing the shown interactive commands with the same commands in a bash script, including the stated shebang, and inspect how termux-location is invoked in each case. Reproduce the missing or null output and identify the execution difference; done means the script prints the expected location output.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, bash
Domain
cli, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.