Browse Source

termux: do not set LC_CTYPE & LC_MONETARY (failing)

/data/data/com.termux/files/usr/lib/python3.6/site-packages/xonsh/environ.py:136: RuntimeWarning: Failed to set locale 'LC_CTYPE' to 'de_AT.UTF-8'
  warnings.warn(msg, RuntimeWarning)
/data/data/com.termux/files/usr/lib/python3.6/site-packages/xonsh/environ.py:136: RuntimeWarning: Failed to set locale 'LC_MONETARY' to 'de_AT.UTF-8'
  warnings.warn(msg, RuntimeWarning)
Fabian Peter Hammerle 5 years ago
parent
commit
d0bda069fe
1 changed files with 14 additions and 12 deletions
  1. 14 12
      rc.xsh

+ 14 - 12
rc.xsh

@@ -1,3 +1,15 @@
+import contextlib
+import datetime as dt
+import io
+import os
+import re
+import shutil
+import stat
+import subprocess
+import sys
+
+TERMUX=shutil.which('termux-info') is not None
+
 $VI_MODE = True
 $AUTO_PUSHD = True
 $XONSH_AUTOPAIR = True
@@ -33,16 +45,6 @@ $PROMPT = ''.join([
 $RIGHT_PROMPT = '{gitstatus}{env_name: {}}'
 $XONSH_APPEND_NEWLINE = True
 
-import contextlib
-import datetime as dt
-import io
-import os
-import re
-import shutil
-import stat
-import subprocess
-import sys
-
 os.umask(stat.S_IWGRP | stat.S_IRWXO) # 027
 # default locale
 # will be used for all non-explicitly set LC_* variables
@@ -56,9 +58,9 @@ $LANG = 'en_US.UTF-8'
 $LANGUAGE = ':'.join(['en_US', 'en'])
 $LC_COLLATE = 'C.UTF-8'
 # char classification, case conversion & other char attrs
-$LC_CTYPE = 'de_AT.UTF-8'
+if not TERMUX: $LC_CTYPE = 'de_AT.UTF-8'
 # $ locale currency_symbol
-$LC_MONETARY = 'de_AT.UTF-8'
+if not TERMUX: $LC_MONETARY = 'de_AT.UTF-8'
 # $ locale -k LC_NUMERIC | head -n 3
 # decimal_point="."
 # thousands_sep=""