Terminal: I should be able to turn off the "pasting multiple lines" warning.

Created on 31 Aug 2020  路  5Comments  路  Source: microsoft/terminal

Description of the new feature/enhancement

When I paste into the terminal and my copied text includes a newline, I get a warning stating

You are about to paste text that contains multiple lines. If you paste this text into your shell, it may result in the unexpected execution of commands. Do you wish to continue?

Since I perform this action many times a day as part of my work, I'm well aware of the risk inherent to pasting commands with newlines in them. I would love a way to turn this warning off completely in the app's settings.

Proposed technical implementation details (optional)

Issue-Feature Needs-Tag-Fix Needs-Triage

Most helpful comment

You can do that in the global section by using:

"multiLinePasteWarning": false,

Check the release notes of v1.2.2022.0

All 5 comments

You can do that in the global section by using:

"multiLinePasteWarning": false,

Check the release notes of v1.2.2022.0

Yup.

This is also in the documentation at https://docs.microsoft.com/windows/terminal!

I tried adding the above to my settings but I still get prompted. I also don't see this in defaults.json?

Select-String -Pattern "Paste" -Path "C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\defaults.json"

C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\defaults.json:335:        {
"command": "paste", "keys": "ctrl+shift+v" },
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.3.2651.0_x64__8wekyb3d8bbwe\defaults.json:336:        {
"command": "paste", "keys": "shift+insert" },

Thanks

@divsyd Put it in the "root" of the settings.


Working example

    // This file was initially generated by Windows Terminal 1.3.2651.0
    // It should still be usable in newer versions, but newer versions might have additional
    // settings, help text, or changes that you will not see unless you clear this file
    // and let us generate a new one for you.

    // To view the default settings, hold "alt" while clicking on the "Settings" button.
    // For documentation on these settings, see: https://aka.ms/terminal-documentation
    {
        "multiLinePasteWarning": false,

        "$schema": "https://aka.ms/terminal-profiles-schema",

        "defaultProfile": "{837e823b-6f8e-5b96-be1e-a29c2a12456a}",

        // You can add more global application settings here.
        // To learn more about global settings, visit https://aka.ms/terminal-global-settings

        // If enabled, selections are automatically copied to your clipboard.
        "copyOnSelect": true,

        // If enabled, formatted data is also copied to your clipboard
        "copyFormatting": true,

        // A profile specifies a command to execute paired with information about how it should look and feel.
        // Each one of them will appear in the 'New Tab' dropdown,
        //   and can be invoked from the commandline with `wt.exe -p xxx`
        // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
        "profiles":
        {
    [...]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alabuzhev picture alabuzhev  路  3Comments

wkbrd picture wkbrd  路  3Comments

ghvanderweg picture ghvanderweg  路  3Comments

TayYuanGeng picture TayYuanGeng  路  3Comments

mrmlnc picture mrmlnc  路  3Comments