Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 669
Craig Walker Avatar asked Sep 09 '16 19:09

Craig Walker


People also ask

How do I get Output Output in Visual Studio Code?

To display the Output window whenever you build a project, in the Options dialog box, on the Projects and Solutions > General page, select Show Output window when build starts.

How do you use input and output in VS Code?

Go to settings (ctrl+,) -> Search settings -> : Code-runner : Run in terminal - Check this and you will be able to run the code directly in the terminal which takes input. :) Show activity on this post. Make sure you have code runner installed on your VS code. By default it remains unchecked.


1 Answers

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 
like image 127
CodeMonkey Avatar answered Sep 24 '22 06:09

CodeMonkey