Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] CJK charactors support? #243

Open
CarterLi opened this issue Sep 13, 2024 · 5 comments
Open

[BUG] CJK charactors support? #243

CarterLi opened this issue Sep 13, 2024 · 5 comments

Comments

@CarterLi
Copy link

Simple command results in messy output

$ ps -ef | moar

image

It turns out to be caused by the CJK charactors 上午. If I use LANG=C ps -ef | moar it displayed normally

image
@CarterLi
Copy link
Author

Reproduce: moar ps.txt

@walles
Copy link
Owner

walles commented Sep 13, 2024

Thanks for the repro!

This could be possible to handle using something like https://github.com/mattn/go-runewidth to figure out string lengths.

No promises for a fix, but I want this to work.

@walles
Copy link
Owner

walles commented Sep 13, 2024

... which seems to be based on this library: https://github.com/rivo/uniseg

@CarterLi
Copy link
Author

wcwidth(3) can be used in C. Not sure about go though.

@walles
Copy link
Owner

walles commented Sep 15, 2024

Unrelated note here, if you tend to use ps, I can recommend trying my ps replacement px:

https://github.com/walles/px

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

No branches or pull requests

2 participants