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

multiple-byte characters may cause problem #4

Open
neekey opened this issue May 4, 2016 · 3 comments
Open

multiple-byte characters may cause problem #4

neekey opened this issue May 4, 2016 · 3 comments

Comments

@neekey
Copy link
Owner

neekey commented May 4, 2016

I encountered terminal logs like below ( from command ps ux ):

USER     PID  %CPU %MEM      VSZ    RSS   TT  STAT STARTED      TIME COMMAND
neekey   908  13.0  2.0  5214472 333228   ??  S    四01下午 399:38.94 /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
neekey   480  10.4  1.3  3901300 212684   ??  U    四11上午  14:11.36 /System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Resources/storedownloadd
neekey  1022   5.0  0.1  2688408  13840   ??  S    四01下午   6:50.36 /Applications/ShadowsocksX.app/Contents/MacOS/ShadowsocksX
neekey 43640   4.0  0.9  3370460 157984   ??  S    二11上午  20:08.77 /Applications/WeChat.app/Contents/MacOS/WeChat
neekey 51311   3.6  0.7  4141496 110668   ??  Ss    1:52下午   0:43.72 /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
neekey 47734   2.5  0.6  1250660 103120   ??  S    10:07下午  28:24.81 /Applications/Steam.app/Contents/MacOS/steam_osx
neekey 52560   1.8  1.9  4074920 324268   ??  S     3:23下午   1:57.04 /Applications/Google Chrome.app/Contents/Versions/50.0.2661.86/Google Chrome Helper.app/Contents/MacOS/Google Chrome Helper --type=renderer --enable-features=Automat

First of all the two-column width Chinese characters will break the logic of coordinate calculation. And the overlap of the values of TIME and COMMAND will really confuse the algorithm I proposed here.

I think it's time to dive into the implementation of how terminals output these log tables.

Any thought or suggestion will be helpful

@neekey
Copy link
Owner Author

neekey commented May 4, 2016

@vangie really did a great work by implementing this module https://github.com/vangie/east-asian-width, which can detect full-width and half-width unicode character.

@neekey neekey changed the title non-english characters may cause problem multiple-byte characters may cause problem May 31, 2016
@WebDiamond
Copy link

Hi , it is possible to kill a process by name and not pid ??

@waheedsd
Copy link

Hi , it is possible to kill a process by name and not pid ??

https://www.npmjs.com/package/kill-process-by-name

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

3 participants