ports の make configで表示が化ける
14.0R あたりからなのですが、ports のビルド時にデフォルトのオプションから変更したい場合に make configで設定を変更しようとすると locale またはターミナルの環境によっては表示されるダイアログの表示が化けてしまう場合がある様です。
こんな感じ
原因
この原因ですが、/usr/ports/Mk/Script/以下にある dialog4ports.sh と思われます。
dialog4ports.sh から抜粋
# Backwards compat with older version which used stdout [<= 0.1.1] (or stderr [0.1.2]).
# Clear environment of PKGNAME or the dialog will show on older versions
# that do not understand -v.
if ! env -u PKGNAME ${DIALOG4PORTS} -v > /dev/null 2>&1; then
exec env LC_ALL=C.UTF-8 $DIALOG4PORTS > $OPTIONSFILE 2>&1
fi
# Newer versions use stderr to work around a jail issue
# http://lists.freebsd.org/pipermail/freebsd-ports/2013-March/082383.html
exec env LC_ALL=C.UTF-8 $DIALOG4PORTS 2> $OPTIONSFILE
DIALOG4PORTS を呼び出す際に環境変数 LC _ALL を強制的に UTF-8 に設定しているのが原因の様なので, LC_ALL=C .UTF-8 を LC_ALL=C に変更すると以下の様に正常に表示される様になります。
対処後
おまけ
git log で dialog4ports.sh の 変更履歴を見るとこんな記述が...
Date: Wed Oct 11 09:54:12 2023 +0200
dialog: force UTF-8 locale
On some terminal, namely "putty" and "linux", the unicode capability
are not properly exposed, resulting in a not so nice UI, forcing
the env to be unicode friendly with executing the DIDALOG commnands
make the output nice in those environements
一部のターミナルで不具合があるので対処したとの事ですが、全てのユーザ環境に対応するのは中々難しいのかもしれません。