-
Notifications
You must be signed in to change notification settings - Fork 28.7k
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
Implement multiLinePasteWarning in VSCode terminal, similar to Windows Terminal behavior #122683
Comments
I think it would be good to have an opt-in setting for this as I've accidentally pasted the wrong thing as well which could be destructive. Opening up to PRs |
hi, can I work on this issue?
|
Hey @slidoooor - I haven't done any work on this yet. If you're interested, please do! |
okay,I will try to solve this problem :) |
@misolori any opinions here for how to present this warning when pasting multiple lines into the terminal? It'll probably be opt-in and ideally I think it would have a preview of the first 2 lines. |
Currently I am handling this situation by making a judgment before we execute paste:
But it's not easy to get to the clipboard here We can also handle it here and can easily get the clipboard:
But this means that all pastes in the terminal will be detected (e.g right click behavior paste) |
Not sure what the right behavior is here, does Windows Terminal show it on right click as well? |
I tried it and it does prompt |
Perhaps we could have three options, prompt for a brief message, prompt for the first two lines, and not prompt at all |
Not sure what the right text should be, here's another example from iTerm: I do like how simple the "confirm on delete" dialog looks with the preview: How about something like:
|
Looks great 👍, @slidoooor let's go with that. We could enable it by default with the don't ask me again checkbox to change the setting for you. |
@Tyriar @misolori Hi!, I committed the latest changes and it currently looks like this. Another small problem is that I am handling the lines by separator, and if the user's pasteboard has only two lines, but each line is very long, there will also be a lot of content displayed, e.g: (I guess there won't be many people writing articles in vscode and using the terminal at the same time XD |
Implement multiLinePasteWarning in VSCode terminal,fix the #122683
In my test it doesn't care about the current Paste Bracketing state. It should be fine (no warning) if current program can handle multi-line paste. EDIT: Tested in Windows Terminal, no warning if Paste Bracketing is on. |
@yume-chan 👍 created #142525 |
Please implement a multiLinePasteWarning for the VSCode integrated terminal, similar to Windows Terminal.
More times than I care to admit, I've accidentally pasted bad text into a VSCode integrated terminal session - often due to either the wrong panel being in focus, or fat fingering an unintended right-mouse-click at a bad place/time.
VSCode workspaces have replaced 99% of my standalone terminal usage these days. Having that safety net is by far the top of my missing-features wish list.
(... and I was surprised to come up empty handed when searching for an existing setting or open issue.)
The text was updated successfully, but these errors were encountered: