Visual Studio Code - Terminal (PowerShell) - how to copy text

I don't know which version of Visual Studio Code you are using, but there has been this user setting for a while (maybe a year; I could be wrong):

// A set of command IDs whose keybindings will not be sent to the shell and instead always be handled by Code. This allows the use of keybindings that would normally be consumed by the shell to act the same as when the terminal is not focused, for example Ctrl + P to launch Quick Open.
  "terminal.integrated.commandsToSkipShell": [

     "workbench.action.terminal.copySelection",
     "workbench.action.terminal.paste",
  ],

There are a bunch more commands in there. I am just showing the ones you are interested in. By default those copy/paste commands are already in there.

If I disable the copySelection command I get the behavior you are seeing. So you may need to either update Visual Studio Code to a newer version or make sure the above setting does appear in your user settings. As I said it is there by default for me, but perhaps something got changed for you.

[Edit in February, 2018]:

Visual Studio Code 1.20 added the setting to automatically copy to the clipboard whatever you select in the terminal. See copy on selection.

Copy on selection

You can now automatically copy whenever you select text in the terminal:

"terminal.integrated.copyOnSelection": true

This is disabled by default.

So merely selecting any text copies it to the clipboard.


The solution above didn't work for me. For anybody looking for an answer: currently copy and paste in VS code terminal is bound to ctrl+insert and shift+insert.


To Copy a message in PowerShell visual studio just select the message and right click it, it will be copied automatically.