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?
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With