Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
spilliams opened this issue Aug 31, 2020 · 9 comments
Closed

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

spilliams opened this issue Aug 31, 2020 · 9 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@spilliams
Copy link

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)

@spilliams spilliams added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 31, 2020
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 31, 2020
@linuxtm
Copy link

linuxtm commented Aug 31, 2020

You can do that in the global section by using:

"multiLinePasteWarning": false,

Check the release notes of v1.2.2022.0

@DHowett
Copy link
Member

DHowett commented Aug 31, 2020

Yup.

@DHowett DHowett closed this as completed Aug 31, 2020
@DHowett
Copy link
Member

DHowett commented Aug 31, 2020

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

@divsyd
Copy link

divsyd commented 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

@ecspresso
Copy link

@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":
        {
    [...]

@jimmycd
Copy link

jimmycd commented Jan 8, 2022

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

@sisrfeng
Copy link

sisrfeng commented 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

@MrDebnath
Copy link

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

@zadjii-msft
Copy link
Member

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

9 participants