sindresorhus/ps-list

Do you want to work on this issue?

You can request for a bounty in order to promote it!


1 active bounty request

$40.00
Solve someone else's bounty request by clicking on it and completing the funding to earn additional credits

Add new properties for the path and arguments separately #7

sindresorhus posted onGitHub

Currently there's process.cmd, but it includes both the path and arguments. Would be useful for https://github.com/sindresorhus/fkill-cli/issues/16 to have separate process.path and process.args properties.

Context:

I looked into this more, and I might have a solution to get the arguments without the full path. It seems ps -o pid -o comm returns the full path without arguments and ps -o pid -o command returns with arguments. So we could get both columns and just diff them to get the arguments. I think this should be added as a new property in ps-list. So we could add an args property with just the arguments and a path property with the full path to the binary without arguments, just for completeness.


@coffeedoughnuts @AlexTes Thoughts on this? Does it make sense? If not, any better suggestions?

posted by sindresorhus almost 8 years ago

I think that makes sense; and it's an additive change yes? No won't break anything if theres an issue with it.

posted by coffeedoughnuts almost 8 years ago

Hmm, I'm not that familiar with ps. It has a long manual. I would like to give it another once over to see if there are options to get the distinction command/arguments into one column. Less is more 😄.

posted by alextes almost 8 years ago

@issuehunt has funded $40.00 to this issue. See it on IssueHunt

posted by IssueHuntBot about 6 years ago

command from ps output can be changed by the process, in which case it usually won't contain arguments and the name might not be what you expect. So I think it's impossible to do do it without causing a lot of pain to devs(and bug reports from them).

Can be done with different API, but that would require using more than just ps and would require writing a whole article on what is what for linux(/similar) process.

posted by stroncium over 4 years ago

I think the conclusion from the issue and many others here is that ps is just junk for programmatic access.

posted by sindresorhus over 4 years ago

Can be done with different API, but that would require using more than just ps and would require writing a whole article on what is what for linux(/similar) process.

What other API? And why would it require writing a whole article?

posted by sindresorhus over 4 years ago

Ideally, someone would write a cross-platform binary for this in Rust and we could just bundle some binaries for each platform, and fall back to ps if those fail or something.

posted by sindresorhus over 4 years ago

Fund this Issue

$40.00
Funded
Only logged in users can fund an issue

Pull requests

Recent activities

yaodingyd submitted an output to  sindresorhus/ ps-list# 7
about 6 years ago
issuehunt funded 40.00 for sindresorhus/ps-list# 7
about 6 years ago