[Konsole-devel] [Bug 89299] prevent paste of newline characters

William M.Hilton wmhilton at gmail.com
Thu Dec 28 20:25:51 UTC 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=89299         




------- Additional Comments From wmhilton gmail com  2006-12-28 21:25 -------
@ Kurt Hindenburg and Maarten ter Huurne:
It is common to copy and paste terminal commands from places like ubuntuforums.org, and it's easy to accidentally copy multiple lines of text. I've done it, and although it hasn't been disastrous yet, it could be.

For instance, say I want to see if upgrading my system from Kubuntu Dapper to Edgy Eft would create unmet dependencies. I copy "sudo apt-get dist-upgrade" from a how to, with the intention of pasting it in Konsole and inserting the "-s" option to simulate an upgrade. But I accidentally copy a part of the next line too, so when I middle click "sudo apt-get dist-upgrade" executes, I don't know how to stop it, and it completely trashes my computer!

Attributing the problem to "human error" doesn't mean we can't improve Konsole's behavior to make it less dangerous; we install seat belts in cars to make them safer, even though seat belts are only needed because of occasional "human error."

The simplest thing to do would be to filter text that is being pasted to replace newlines with semicolons. That way users could copy multiple commands, but not have them execute automatically. In the example above, for instance, middle clicking would only result in "sudo apt-get dist-upgrade; sud", assuming that part of the next line was copied.

Konsole could probably be patched in minutes. All that needs to be done is filter text that's being pasted and replace \n with ;.



More information about the konsole-devel mailing list