On Sat, 28 Nov 2009 12:24:27 +0100 Enrico Tröger enrico.troeger@uvena.de wrote:
When working with R files, in order to use "Send selection to terminal" one would want to append a newline to the selection. While this can often be done manually in the written code, it can get awkward to do so when in need to execute only one line from the middle of a paragraph.
Well, I think it's a great feature that line breaks are not added magically. This could do much harm if one selects something like "rm -rf ~" (not the most originally example but still). I really think if the user really wants to execute this selection, he/she should either include the line break or hit Enter/Return manually in the terminal. Automatically executing commands is always risky.
Personally I think the unchanged selection could be sent to the terminal. After all, the current behaviour allows multiple lines to be sent, so with:
./foo ./bar
./foo is already executed.
I understand the possibly harmful consequences, but I'm not sure they are particularly likely.
Another option would be to popup a dialog to confirm the selection being sent, so the user wouldn't have to focus the terminal and press enter and focus the editor again, just press enter for an 'Execute' button.
Regards, Nick
P.S. I will move this command's menu item to the new Commands menu as it's not really formatting related.