augustocdias / vscode-shell-command

A task helper to use system commands as input
MIT License
51 stars 19 forks source link

Add possibility to read output from stderr #86

Closed AJIOB closed 4 weeks ago

AJIOB commented 7 months ago

Current behavior

Plugin reads from the stdout only

Suggested behavior

We can select to read from stdout, stderr or from both of them

Why need

By default, CMake prints NOTICE messages to the stderr (the messages without dashes). More info here.

augustocdias commented 7 months ago

This should be doable. We'd need to use the spawnSync function instead of execSync

https://nodejs.org/api/child_process.html#child_processspawnsynccommand-args-options

MarcelRobitaille commented 7 months ago

Wouldn't it be possible to do all of this with redirects? "command": "cmake blah blah 2>&1" You can also select only the stderr "command": "cmake blah blah 2>&1 1>/dev/null"

AJIOB commented 7 months ago

Wouldn't it be possible to do all of this with redirects? "command": "cmake blah blah 2>&1" You can also select only the stderr "command": "cmake blah blah 2>&1 1>/dev/null"

It's ok if it possible to do on Windows & Linux together, not by creating two different tasks