ble.sh icon indicating copy to clipboard operation
ble.sh copied to clipboard

[Termux] Remove warnings on startup

Open ilivetruth opened this issue 6 months ago • 3 comments

I am using ble.sh on my Android phone using termux, and everything works just fine.

How can I disable these warnings?

Also, thanks for building this awesome tool, I use it everywhere!

ble.sh: insane environment: $USER is empty. ble.sh: modified USER=u0 a516
ble.sh: The locale 'en_US.UTF-8' (LC_CTYPE) seems broken. Please check that the locale exists in the system.

ilivetruth avatar Jun 20 '25 16:06 ilivetruth

ble.sh: insane environment: $USER is empty. ble.sh: modified USER=u0 a516

This means that the variable USER is not set in your environment, which is the problem of the environment. For this error, you can set the user name in ~/.bashrc (before sourcing ble.sh):

# bashrc

: "${USER:=$(id -un)}"
export USER
ble.sh: The locale 'en_US.UTF-8' (LC_CTYPE) seems broken. Please check that the locale exists in the system.

This is an issue of the Termux environment, where the behavior of en_US.UTF-8 provided by the Termux environment is broken. This is already reported at #507. The situaion is described in https://github.com/termux/termux-packages/discussions/23010#discussioncomment-12487582 in detail. If you want to avoid this problem and do not use UTF-8, please set LANG=C (before sourcing ble.sh):

# bashrc

LANG=C

edit: This doesn't solve the underlying issue with the Termux locales, but it should at least suppress the error (by skipping the check).

akinomyoga avatar Jun 20 '25 17:06 akinomyoga

Discussions are ongoing.

  • https://github.com/akinomyoga/ble.sh/issues/507
  • https://github.com/termux/termux-packages/discussions/23010
  • https://github.com/termux/termux-packages/issues/25149

akinomyoga avatar Jun 27 '25 02:06 akinomyoga

In commit ea1e547bc0ffd39e62a2011b4b4530024d6c91da, I updated the warning message for the Termux environment to make it more precise. I also added a link to the upstream discussion.

akinomyoga avatar Jul 20 '25 12:07 akinomyoga