While vscode has no built-in feature to save the terminal outputs to a file, you can copy and paste the content into 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 can save the vscode terminal output.
Terminal settings, enable context menu as the default behaviour
- 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 terminal
- 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.
We have tested this working in vscode on Windows 11. The same steps should work in other Windows/VScode combinations as well.
While vscode has no built-in facility for saving terminal outputs to a file, you can copy and paste the text into a file. I have demonstrated enabling the context menu by right-clicking if you can’t get it. After setting this up, you can save the output from the vscode terminal.