You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running nested npm commands like implicit pre and post scripts (pretest, prepack, preinstall...), they are run on new spawned processes, with the only reference to where they start by the process banner, but there's no indication of where they end or their relationship, since output is flat.
Expected Behavior
I would like that when a npm command is exec as direct or indirect result of a previous npm command, that its output gets indented, so it's easier to see where they start and end and who's its parent npm process. To do it, we would need to do:
detect we are running as a nested npm command, if not proceed as usual.
use https://nodejs.org/api/tty.html or https://nodejs.org/api/readline.html to create a virtual TTY where to run the command, instead of using inherit. Also handle the resize event, and maybe mimic someway the commands they are not running on a TTY if the parent process doesn't does it.
process the output to the stdout and stderr of the virtual TTY, and indent it for each new newline that arrives
Steps To Reproduce
No response
Environment
npm: 9.6.7
Node: v20.3.1
OS: Ubuntu Linux 23.04
platform: x86_64
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Current Behavior
When running nested
npm
commands like implicitpre
andpost
scripts (pretest
,prepack
,preinstall
...), they are run on new spawned processes, with the only reference to where they start by the process banner, but there's no indication of where they end or their relationship, since output is flat.Expected Behavior
I would like that when a
npm
command is exec as direct or indirect result of a previousnpm
command, that its output gets indented, so it's easier to see where they start and end and who's its parentnpm
process. To do it, we would need to do:npm
command, if not proceed as usual.inherit
. Also handle theresize
event, and maybe mimic someway the commands they are not running on a TTY if the parent process doesn't does it.stdout
andstderr
of the virtual TTY, and indent it for each newnewline
that arrivesSteps To Reproduce
No response
Environment
The text was updated successfully, but these errors were encountered: