How to save the Terminal output to file in vscode?

While vscode does not have a built-in feature to save the terminal outputs to a file, you can do the same by copying the content and paste it to a file. If you are not getting the context menu by right-clicking, I am providing the steps to enable it. Once you have configured this, you will be able to save the vscode terminal output.

Terminal settings, enable context menu as the default behavior

  • You can do this by going to the settings page: Configure Terminal Settings:
    • Go to the File menu
    • Preferences – Settings
    • Then enter: @feature:terminal
  • Scroll down to Right click behaviour, as shown in the below image
  • Select, Show the context menu as the default behaviour
  • After you enable this, you will be able to:
    • Right-click on your teminal
    • Select All Text
    • Right click on the selection and click Copy ( or Ctrl +C to copy)
    • Paste the contents in a text editor (Ctrl + V), such as notepad.
Demo: vscode save terminal output to file

We have tested this working in vscode on Windows 10. The same steps should work in other combinations as well.