SUMMARY When I paste a commend that is ended with \n (newline) it is not executed until I press Enter. STEPS TO REPRODUCE 1. Create a line command in any text editor, say "ls" 2. Select this line with the ending \n 3. Go to the konsole and press the middle button OBSERVED RESULT The command will be pasted with the \n but is not executed EXPECTED RESULT The command should be pasted AND executed SOFTWARE/OS VERSIONS Operating System: Slackware-current KDE Plasma Version: 5.20.5 KDE Frameworks Version: 5.78.0 Qt Version: 5.15.2 Kernel Version: 5.10.6 OS Type: 64-bit Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz Memory: 31.1 GiB of RAM Graphics Processor: Mesa Intel® UHD Graphics 630
If we did this, it would be possible for people to copy-paste malicious code they find online that executes immediately.
It makes no difference for them as they will press Enter as well.
Created attachment 135202 [details] Copy new line It is already possible to copy a new line, you have to select the line until the beginning of next line, this way it will select the '\n'.
Yes, it does insert, but not reacts. So I need to press Enter every time. It is very annoying. If you insist that new behaviour should exist, there should be a setting for it.
Dmitri, I won't be adding a setting for this. I agree with the other users that this is a security concern, and it's doable that a ctrl + c on a website can inject malicius code, so you have the opportunity to check if the pasted command is indeed `ls -l` instead of `sudo rm -rf /` Press enter if you copy / paste code. or, create functions on your bashrc with the appropriate code that you are pasting so often. Best.
I don't think this is specific to konsole; bash/readline has bracketed-paste, if it's enabled the shell will behave the way you describe. You can enable/disable bracketed-paste by editing /etc/inputrc and adding a line: set enable-bracketed-paste off See: https://www.gnu.org/software/bash/manual/bash.html#index-enable_002dbracketed_002dpaste https://www.gnu.org/software/bash/manual/bash.html#Readline-Init-File-Syntax (If you want the change to be in your user account only, you can also create a ~/.inputrc file: $include /etc/inputrc set enable-bracketed-paste off ) Note that bash/readline in recent versions have enabled bracketed-paste by default: https://lwn.net/Articles/839212/
thanks
*** Bug 443292 has been marked as a duplicate of this bug. ***