Terminal should issue a confirmation popup when pasting multiple lines
@teo8976
Submitted by Teo Tei Link to original bug (#749084)
Description
It's far too easy to copy and paste a block of text by mistake into a terminal. For example, you copied a command you wanted to paste, then you copied some text for other purposes and forgot about it, then you go to the terminal and paste, thinking you are pasting a line, and instead you paste 500 lines of text (e.g. code in some programming language), which has potentially disastrous effects, the most relevant being:
- if accidentally pasting dozens of lines of code, though most result in errors, there are high chances that more than a few happen to be valid (though nonsense) bash commands, and you may end up creating dozens of files with nonsense names, and in some cases even deleting files
- you loose all your bash history, because it has a limit and you fill it with garbage.
So, when you paste into the Terminal and the pasted text is more than one line, it should ask for confirmation. There should be a "don't ask again" checkbox for those who may be annoyed by this prompt. The "don't ask again" would last for the current session; perhaps a way could be designed to have some setting editable somewhere for those who want to disable this feature completely. But it should be enabled by default.
That you can destroy a system just by accidentally pasting a document into a terminal, is simply ridiculous.