Join the community today
Register Now

Beta Branch fix broken _dmotd_fancy_capable() locale gate and $COLUMNS ordering i…

Discussion in 'Centmin Mod Github Commits' started by eva2000, May 20, 2026.

  1. eva2000

    eva2000 Administrator Staff Member

    58,893
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    8:41 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    fix broken _dmotd_fancy_capable() locale gate and $COLUMNS ordering in 140.00beta01

    Two related capability-gate fixes:

    CX1 — Capture inbound locale before the L14-17 export block forces
    LC_ALL/LANG/LC_CTYPE to en_US.UTF-8. The gate at _dmotd_fancy_capable()
    previously read the just-exported values, making the UTF-8 check a
    no-op: it always passed regardless of the user's actual terminal
    locale. Now the gate consults _dmotd_user_lc_all / _dmotd_user_lc_ctype
    / _dmotd_user_lang captured at script start, restoring the design
    intent. Users with LC_ALL=C or LANG=POSIX on capable-looking
    terminals no longer silently get fancy rendering with mojibake.


    CX2 — Probe tput cols </dev/tty first; fall back to $COLUMNS only
    when tput cannot determine width. A stale exported $COLUMNS from a
    previously-wider terminal (e.g. tmux split, multiplexed session)
    would otherwise let fancy activate on a now-narrower PTY.

    Continue reading...

    140.00beta01 branch