Why does the CLI override the process title?

In the npm CLI, process.title is overridden to be 'npm'.

This has the potential advantage of cleaning up the output of ps or pgrep, but it has the downside of hiding the arguments that the CLI was invoked with.

I discovered this because I use a tmux plugin called “resurrect” that is able to save and restore tmux sessions. It is able to automatically restart running programs for you, but specifically mentions not being able to restart npm because its arguments are not available in the output of ps.

Why does the CLI override process.title? Would the CLI team be open to removing the override?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.