Skip to content

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

Open
zhzy0077 wants to merge 1 commit intortk-ai:developfrom
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:developfrom
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

@pszymkowiak
Copy link
Collaborator

Hi! Thanks for the contribution! Since March 6, all PRs should target the develop branch instead of master (see CONTRIBUTING.md).

Could you update the base branch? Click Edit at the top right of this PR and change it from master to develop.

Thanks!

@zhzy0077 zhzy0077 changed the base branch from master to develop March 12, 2026 02:53
@zhzy0077
Copy link
Author

Hi! Thanks for the contribution! Since March 6, all PRs should target the develop branch instead of master (see CONTRIBUTING.md).

Could you update the base branch? Click Edit at the top right of this PR and change it from master to develop.

Thanks!

DONE. Thanks for the reminder.

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.

2 participants