diff options
author | 2025-01-17 19:25:23 +0100 | |
---|---|---|
committer | 2025-01-17 19:25:23 +0100 | |
commit | d08ee7b1f0ae2bbd3491939557032c6117807dae (patch) | |
tree | 4e4cc1e28924e2e77dae62556c6126c75748d5fc /env.zsh | |
parent | f598c8aac0a93ff477974d3bbde14aef34c0ae85 (diff) | |
download | zuwu-d08ee7b1f0ae2bbd3491939557032c6117807dae.tar.gz zuwu-d08ee7b1f0ae2bbd3491939557032c6117807dae.tar.bz2 zuwu-d08ee7b1f0ae2bbd3491939557032c6117807dae.tar.lz zuwu-d08ee7b1f0ae2bbd3491939557032c6117807dae.zip |
feat: ensure LANG and LC_ALL are set
Diffstat (limited to 'env.zsh')
-rw-r--r-- | env.zsh | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -7,4 +7,18 @@ # memdmp <https://mem.estrogen.zone/> # -# Currently empty, however this may change at a later date to, for example, load a .config/env & .config/env.d/, or similar. +# Currently, we just ensure your environment is sensible - e.g. we ensure your LANG is well-defined, etc... +if [[ "$VALIDATE_LANG" != "false" ]]; then + if [[ "$LANG" == "" ]] || [[ "$LANG" == "C" ]]; then + # Modern systems will have UTF-8 everywhere outside of a TTY. + # Login Shells are the only shell likely to be a TTY (although theoretically other shells could also be login shells, but like idc if 1% of thigns break). + if [[ "$-" == *l* ]]; then + export LANG="C.UTF-8" + else + export LANG="C" + fi + fi + if [[ "$LC_ALL" == "" ]] || [[ "$LC_ALL" == "C" ]]; then + export LC_ALL="$LANG" + fi +fi |