8 ms·
Kind of offtopic but is there a linux terminal program that when you paste a bunch of commands with carriage returns asks you if you want to continue?
by brian_herman 9y ago
Kind of offtopic but is there a linux terminal program that when you paste a bunch of commands with carriage returns asks you if you want to continue?
- notamy 9y agoI don't think something like that exists; the closest I've seen to anything like that is pantheon-terminal prompting you about pasting when a command is sudo
- laumars 9y agoI'm not sure I understand your question correctly but KDE's terminal (konsole) warns you if you try to paste large amounts of text
- brian_herman 9y agoSo if you have the following command: echo "hello" python -v I want it to warn me if there are returns or carrage returns in the paste. iterm does this
- xiaq 9y agoSome terminal emulators / shells use some heuristics, but the most reliable way is to use a combination of a terminal emulator and shell that support bracketed paste mode. This article (https://cirw.in/blog/bracketed-paste https://cirw.in/blog/bracketed-paste) lists some terminal emulators that supports bracketed paste, and a zsh plugin that makes zsh handle bracketed paste in a safe manner. As an alternative to zsh, Elvish (https://github.com/elves/elvish https://github.com/elves/elvish) supports bracketed paste out of the box. When you paste anything that includes a carriage return, Elvish will insert a literal return instead of executing it. (Disclaimer: I am the author of Elvish.)