Search code examples
consolepipephpstorm

Possible to pipe a debug configuration through another command?


Using PHPStorm 6/7 (or WebStorm I guess), is it possible to configure a debug session so that it understands and uses piping to have a more convenient display in the PHPStorm console? I'm working on a nodejs app that utilizes bunyan. I'd like for PHPStorm to be able to pretty print the debug output as it would if I launched the app from the terminal.

Here's an example config:

examle phpstorm debug config

But the command it's trying to run is:

/usr/local/bin/node --debug-brk=57073 app.js -vv 2>&1 "|" bunyan

If it wouldn't quote the pipe symbol, it might work, but I'm not sure.


Solution

  • Pipes is a feature of the command line shell, PhpStorm doesn't use shell to start your configuration, so pipes and output redirection will not work.

    Slightly related issues:

    You can probably hack some wrapper shell script around node and use it instead of the default node script. Your custom shell script can parse the arguments in its own way and perform piping. Not sure how well it will work.