Skip to content

fix(ls): force LC_ALL=C for predictable parsing#463

Open
zhzy0077 wants to merge 1 commit intortk-ai:masterfrom
zhzy0077:fix-ls-locale-empty-output
Open

fix(ls): force LC_ALL=C for predictable parsing#463
zhzy0077 wants to merge 1 commit intortk-ai:masterfrom
zhzy0077:fix-ls-locale-empty-output

Conversation

@zhzy0077
Copy link

@zhzy0077 zhzy0077 commented Mar 10, 2026

On non-English locales (e.g. zh_CN), ls -la output has a different number of columns than the 9 columns assumed by compact_ls. This change forces the C locale to ensure consistent 9-column output for reliable parsing.

e.g. for chinese it's

> ls -lh /etc
总计 1.2M
-rw-r--r-- 1 root root    44  3月 9日 21:44 adjtime
drwxr-xr-x 1 root root    12  3月 9日 21:43 alsa
drwxr-xr-x 1 root root   122  3月10日 10:57 ananicy.d
-rw-r--r-- 1 root root     1 10月13日 00:21 arch-release
-rw-r--r-- 1 root root     0 2025年 4月 1日 arptables.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant