Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 157038

Summary: [misc] Ability to apply a system level command as a filter on the current selection
Product: [Eclipse Project] Platform Reporter: Maxime Daniel <maxime_daniel>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P4 Keywords: helpwanted
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard: stalebug

Description Maxime Daniel CLA 2006-09-12 10:25:31 EDT
Evolved editors, especially in unices land, fairly well support the following scenario:
- define a selection;
- type in a command (whatever program available on the path);
- replace the selection with the output of the said command applied to the original contents of the selection.

Variants exist like displaying the result but not replacing the selection (same typology as our Java debugger Inspect/Display/Execute series), etc., but the most useful one is the selection replacement (you can always undo your changes once to get back to the previous contents).

I have been more than once compelled to drop to a regular shell and use a legacy  editor, then go back to Eclipse and refresh the file contents (say sorting, extracting some fields, counting lines/words, filtering, etc.), and I wondered if adding such a capability could be considered.

Of course, the more powerful the underlying platform, the more useful this would be. Still, it can deliver power on somewhat undergifted systems if they are correctly supplemented by third party tools (say W* + cygwin). It would also lower the learning curve for those who come from vi/emacs/etc. + whatever Unix like system, and help them stay in Eclipse for more of their time.

(Could not find a matching bug, but may have missed it - apologies in advance if this already exists.)
Comment 1 Dani Megert CLA 2006-09-12 10:38:29 EDT
Just to clarify: you want to exectue (shell) commands from the OS inside the workbench, right? 
Comment 2 Dani Megert CLA 2006-09-13 02:36:00 EDT
Setting to REMIND until requested info is ready.
Comment 3 Maxime Daniel CLA 2006-09-13 03:57:03 EDT
Basically, yes.

But what I want is a very specific coordination between the workbench and the said commands. When I only want to run a command that has little correlation with the workbench contents, I drop to a shell and that's fine. What I suggest is that the contents of a (text) selection be filtered by a (combination of) os command(s), using the usual pipe tricks, commands arguments etc. to get what I want.

Taking an example, assume I have the following text contents in scores.txt:

129003 maxime 20060913
12 maxime 20060104
200000 dani 20060412

I could sort it according to dates using:
- Ctrl-A (select everything);
- <new command to invoke an os command>;
- sort -k3 <enter>.
I could suppress your extravagant score using:
- Ctrl-A (select everything);
- <new command to invoke an os command>;
- fgrep -v dani <enter>.
(Which is more efficient for me, given my personal experience, than entering a search/replace in which the clever use of wildcards can get the same effect - basically replace * dani *\n with nothing.)
And then I could combine those in a single interaction:
- Ctrl-A (select everything);
- <new command to invoke an os command>;
- fgrep -v dani | sort -k3 <enter>.

Or whatever. My point is that some people have a capital of working habits that rely heavily on Unix shell, and that it is easier for them to leverage that capital in legacy editors than in Eclipse.
Comment 4 Dani Megert CLA 2006-09-13 04:10:38 EDT
Would it be enough to have this for textual editors or do you also request this for dialogs wizards and other areas?
Comment 5 Maxime Daniel CLA 2006-09-13 05:54:14 EDT
Having it for text editors would be great already. Having said that, if you considered adding the function in a pervasive way accross all text input areas, I wouldn't complain. But I would not push hard for it, the main benefit I would see being design continuity/homogeneity, not the satisfaction of an everyday need.
Comment 6 Dani Megert CLA 2006-09-13 05:56:27 EDT
OK.

Most likely we won't have time to address this feature unless we get a good quality patch.
Comment 7 Lars Vogel CLA 2019-09-06 03:34:07 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it and remove the stalebug whiteboard tag. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.