I should be able to turn off the "pasting multiple lines" warning. #10418

Closed
opened 2026-01-31 02:21:02 +00:00 by claunia · 9 comments
Owner

Originally created by @spilliams on GitHub (Aug 31, 2020).

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)

Originally created by @spilliams on GitHub (Aug 31, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> 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) <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-Fix labels 2026-01-31 02:21:02 +00:00
Author
Owner

@linuxtm commented on GitHub (Aug 31, 2020):

You can do that in the global section by using:

"multiLinePasteWarning": false,

Check the release notes of v1.2.2022.0

@linuxtm commented on GitHub (Aug 31, 2020): You can do that in the global section by using: ` "multiLinePasteWarning": false,` Check the release notes of [v1.2.2022.0](https://github.com/microsoft/terminal/releases/tag/v1.2.2022.0)
Author
Owner

@DHowett commented on GitHub (Aug 31, 2020):

Yup.

@DHowett commented on GitHub (Aug 31, 2020): Yup.
Author
Owner

@DHowett commented on GitHub (Aug 31, 2020):

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

@DHowett commented on GitHub (Aug 31, 2020): This is also in the documentation at https://docs.microsoft.com/windows/terminal!
Author
Owner

@divsyd commented on GitHub (Sep 23, 2020):

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 commented on GitHub (Sep 23, 2020): 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
Author
Owner

@ecspresso commented on GitHub (Nov 10, 2020):

@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":
        {
    [...]
@ecspresso commented on GitHub (Nov 10, 2020): @divsyd Put it in the "root" of the settings. <details> <summary>Working example</summary> ``` // 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": { [...] ``` </details>
Author
Owner

@jimmycd commented on GitHub (Jan 8, 2022):

i can only recommend to keep the warning on even when its annoying:
https://www.wizer-training.com/blog/copy-paste

@jimmycd commented on GitHub (Jan 8, 2022): i can only recommend to keep the warning on even when its annoying: https://www.wizer-training.com/blog/copy-paste
Author
Owner

@sisrfeng commented on GitHub (Jan 10, 2022):

"I use a "scrap" file in a text editor to test what I copied from a web site, since with browsers you can never be sure what exactly you just copied."

Don’t trust cut and paste from web pages

https://github.com/dxa4481/Pastejacking

https://superuser.com/questions/355383/how-can-i-prevent-or-interrupt-accidental-copy-paste-in-the-terminal

@sisrfeng commented on GitHub (Jan 10, 2022): "I use a "scrap" file in a text editor to test what I copied from a web site, since with browsers you can never be sure what exactly you just copied." Don’t trust cut and paste from web pages https://github.com/dxa4481/Pastejacking https://superuser.com/questions/355383/how-can-i-prevent-or-interrupt-accidental-copy-paste-in-the-terminal
Author
Owner

@MrDebnath commented on GitHub (May 26, 2022):

Why don't you make a checkbox option in that warning? This is annoying

@MrDebnath commented on GitHub (May 26, 2022): Why don't you make a checkbox option in that warning? This is annoying
Author
Owner

@zadjii-msft commented on GitHub (May 26, 2022):

We'd love to add a checkbox! See #6641. If you'd like to add them yourself, we'd love the contribution! Now that we've got state.json, adding the checkboxes should be a lot easier!

@zadjii-msft commented on GitHub (May 26, 2022): We'd love to add a checkbox! See #6641. If you'd like to add them yourself, we'd love the contribution! Now that we've got `state.json`, adding the checkboxes should be a lot easier!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10418