On 10/30/2014 07:46 PM, Bob Proulx wrote: > Chet Ramey wrote: >> * paste into the text editor invoked by the `edit-and-execute-command' key >> binding (C-xC-e in emacs mode), edit the command if desired, and have the >> shell automatically execute the contents of the editing buffer when the >> editor exits > > Cool! This was an idea that I hadn't thought about before. (I often > would paste into my editor and clean it up. But doing it as part of > the edit-and-execute-command is very nice!) > > Thanks for this hint!
Be careful with this though as the editor may be more exploitable. I see vim for example interprets <ESC> even in paste mode. It probably shouldn't do that in paste mode, but you can see what happens if you paste from the following innocuous looking HTML page: printf 'echo \033:q!<br>ls' > t.html This just runs the "q" command, but could be anything of course. Pádraig.