Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports.findNodeProcess = function* (filterFn) {
const command = isWin ?
'wmic Path win32_process Where "Name = \'node.exe\'" Get CommandLine,ProcessId' :
// command, cmd are alias of args, not POSIX standard, so we use args
'ps -eo "pid,args"';
'ps -wweo "pid,args"';
Copy link
Member

@fengmk2 fengmk2 Mar 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实老的命令会截断输出

image

修复之后

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-w Use 132 columns to display information, instead of the default which is your window size. If the -w option is specified more than once, ps will use as many columns as
necessary without regard for your window size. When output is not to a terminal, an unlimited number of columns are always used.

const stdio = yield runScript(command, { stdio: 'pipe' });
const processList = stdio.stdout.toString().split('\n')
.reduce((arr, line) => {
Expand Down