In recent versions of Ubuntu, the default GNOME Terminal introduced a safety feature: if you attempt to paste a block of text that contains a hidden newline character (a line break) or uses sudo, the terminal will intercept the paste and display a massive warning dialog box. It asks you to confirm if you actually want to paste the command, warning you that malicious text could automatically execute.
While excellent for beginners who might accidentally paste a dangerous script from a shady website, this warning is incredibly annoying for developers and system administrators. If you routinely paste multi-line configuration blocks or trusted scripts from your own documentation, confirming this dialog box dozens of times a day breaks your workflow. You can disable this security check entirely.
How to Turn Off the Terminal Paste Warning in Ubuntu
You can disable the confirmation dialog directly from the GNOME Terminal preferences.
- Open the Terminal app (press Ctrl + Alt + T).
- Click the hamburger menu icon (≡) in the top-right corner of the terminal window (or click “Edit” on the top bar in older versions).
- Select Preferences from the drop-down menu.
- In the left-hand sidebar of the Preferences window, ensure Global is selected.
- Look for the section titled “Behavior”.
- Uncheck the box labelled Show warning before pasting unsafe text (or Show paste warning).
- Close the Preferences window.
The change is instantaneous. The next time you paste a multi-line script or a command containing sudo, the terminal will instantly drop the text onto the command line exactly as you copied it, without asking for confirmation. Ensure you only paste from trusted sources now that the safety net is gone.