Closed Agent-E11 closed 2 months ago
I have created a draft pull request with some proposed changes #42
Interesting. Since termux is a special case, is there an environment flag we can use to detect Termux and then use a different code path for that?
There is a $TERMUX_VERSION
environment variable, and I am looking into whether that is a reliable way of detecting if it is running in Termux
I have made it so that it checks whether it is in Termux, and will use the "old" or "new" version of the function based on that
On Termux, the
/sys/class/power_supply
exists and "is readable", except it, well, isn't.I have found a method that I think works on both regular Linux and Termux (not Windows though):
This is communicated through the exit code, which is returned by the
os.execute
function (I think Neovim uses Lua 5.1, so this version ofos.execute
only returns the exit code)The problem with this is that the input must be trustworthy, because the
file
could be something like/some/file; rm -rf /