Everytime I paste something into Windows Terminal I get the following annoying message that's attempting to save me from myself.
I don't need it! How can I make it go away?
-
8Note that there are a whole bunch of attacks which rely on making the copied text different from what you saw on the website where you copied from. This warning can probably protect you from a large subset of them.– NobodySep 24, 2021 at 22:21
-
2@Nobody: Damn, that's a really good PSA. It would be great if the clipboard knew the source of the content, that way the warning could be disabled if text is copied directly from another terminal or from text-editor-of-choice.– Oskar SkogSep 25, 2021 at 7:58
1 Answer
From Microsoft's Windows Terminal docs about Terminal Interaction:
Paste warnings:
Warn when the text to paste contains multiple lines
When this is set to true, trying to paste text with multiple lines will display a dialog asking you whether to continue or not with the paste. When it's set to false, the dialog is not shown and instead the text is pasted right away. In most shells, one line corresponds to one command so if you paste text that contains the "new line" character into a shell, one or more command(s) might be executed automatically upon paste, without you having time to validate the commands. This can be useful if you often copy and paste commands from untrusted websites.
Property name: multiLinePasteWarning
Necessity: Optional
Accepts: true, false
Default value: true
To change these settings:
Hold down the Shift key while selecting Settings in the Windows Terminal dropdown menu. This will open the editor associated with json
files, typically Visual Studio Code if installed.
At the root of your settings.json
(not under any other key, just inside the first level of brackets), add:
"multiLinePasteWarning": false,
Make sure to add a comma before or after, depending on where you place it.
For example:
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"multiLinePasteWarning": true,
"actions":
[
...
}