pipestdinvisual-studio-code

How do I pipe output into Visual Studio Code?


I want to pipe the output of a command into a new text window in Visual Studio Code.

Normally, I'd do something like this:

echo foo | code

...but that appears to not work; Visual Studio Code launches, but it does not display the input. Is there a way to do piping on the command line?


Solution

  • Since version 1.19.1, you can pipe your output to the current window by invoking:

    <command> | code -
    

    If you are using version 1.19 or earlier, you don't need the arg:

    <command> | code