In Windows 10, you could paste multiple lines of PowerShell code into the PowerShell window and it would execute all the lines together. This would allow you to CTRL+C out of the execution in case of a problem. It was also useful if you wanted to see all the output together in one block.
In Windows 11 Terminal, the default behavior changed for CTRL+V in that line breaks pasted in would execute sequentially. This means each command pasted would be followed by its own output instead of all the output being blocked together. It also meant if you CTRL+C out of the execution, it only stops the execution of the current command – each command still in the paste buffer would still attempt to execute afterwards.
To change this functionality in Windows 11 Terminal so you can CTRL+V as all one block of code, do the following:
- Open Terminal.
- Click the down arrow on the toolbar and choose Settings.
- Click the cog in the lower left that says Open JSON file.
- Locate this block of text:
{
"command": "paste",
"id": "User.paste",
"keys": "ctrl+v"
},
- Place // in front of each line to comment out the line.
//{
// "command": "paste",
// "id": "User.paste",
// "keys": "ctrl+v"
//},
- Save the file.
Now, pasting in with CTRL+V will paste all lines of copied code before executing.