Detect if running in Termux
I noticed there is an environment variable
TERMUX_VERSION
, is the presence of this variable a reliable way to detect if a bash script is running in Termux?8 Replies
searching is a skill, train it
Bro... I have already. I have seen that thread already and the two solutions in that thread seem unnecessarily janky. Detecting the presence of an environment variable would be much simpler than
grep
ing for a string in $PREFIX
or checking for the presence of a commandor, like in the link i shared
make your own variable
That is what I would do if I had complete control of the system, but I am doing this for a neovim plugin that other people will be using, and I don't want the setup to be unnecessarily complicated
too bad
All I want to know is if
$TERMUX_VERSION
is a variable that I can count on to be set in the Termux shellwell it should