| Summary: | Local Process Terminal - External Tool support | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Tools] Target Management | Reporter: | Ladar Levison <ladar> | ||||
| Component: | Terminal | Assignee: | dsdp.tm.core-inbox <tm.core-inbox> | ||||
| Status: | RESOLVED WONTFIX | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | eclipse, mirko, pawel.1.piech, uwe.st | ||||
| Version: | 3.3 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Ladar Levison
Have you considered using the terminal view from the Target Management project? The Local Terminal view builds atop a bash shell and does honor the color codes. But since my external tool configurations don't execute inside the terminal view I don't think it will help my situation. Basically I have a few scripts I use to extract information from my source files. I recently modified the scripts so they would output messages of importance in different colors. Unfortunately it was only after making the changes that I realized when I launch the scripts as an external tool from inside Eclipse that I can't see the colorized output. I've solved the short term problem by outputting some messages to stderr and highlighting other messages using the Console Grep plugin, but thought I should open the ticket so the issue could (hopefully) be fixed for the Indigo release. (In reply to comment #2) > The Local Terminal view builds atop a bash shell and does honor the color > codes. But since my external tool configurations don't execute inside the > terminal view I don't think it will help my situation. I see, so maybe the enhancement could be rephrased as a request to allow external tool configurations to use the terminal view? > I've solved the short term problem by outputting some messages to stderr and > highlighting other messages using the Console Grep plugin, but thought I should > open the ticket so the issue could (hopefully) be fixed for the Indigo release. This is also a reasonable strategy, you can write your own plugin to decorate the console output. But if you try to interpret all the style information you'll find yourself writing another terminal view. I was thinking Indigo could use the terminal view for displaying console output. Or at the very least allow external tool configurations to execute inside a terminal view. I never expected anyone to recreate the functionality of bash. I looked at the state of the local process terminal support, and it looks like it's very close to what you're looking for. There's an external tool launch configuration but for some reason it's not marked as public so it doesn't show up in the external tools menus. I'm reassigning to terminal component for comment. The Local Terminal actually does come with its own launch configuration type, which is used under the hood to run the shell. However, as the user experience of the launch configuration dialog had some problems, we turned this launch configuration type into a hidden launch configuration. We could certainly address whatever problems there were with the user experience and turn the Local Terminal launch again into a regular, visible launch configuration type. (In reply to comment #6) > We could certainly address whatever problems there were with the user > experience and turn the Local Terminal launch again into a regular, visible > launch configuration type. Cool, it seems that there's at least one user who would benefit from this enhancement :-) The ability to create new launchers that use the local shell would certainly be nice.
How hard would it be to hook into the default external tool config and if the LPT is installed, add a box next to "Allocate Console" option which causes the tool to run inside the LPT shell versus the default? Might be easier than what you had in mind?
I found a solution for the short that others might be interested in. I wrote a script to automate a large number of find/replace actions which is helping me refactor and merge a code base. After running the script its nice to see what was changed, just in case my regexes did something I wasn't intending. Anyways, seeing the diff in color makes a HUGE difference. So I wrote this:
(/usr/bin/gnome-terminal --hide-menubar --full-screen -e \
"/bin/bash -c '/usr/bin/dwdiff --ignore-formatting --no-inserted --color --line-numbers \
--context 1 \"$FILE\" \"$FILE.X\" 2>&1 | /bin/sed -e \"s/^\([0-9 ]\{4\}\):[0-9]\+/\\1/\"; \
/usr/bin/dwdiff --ignore-formatting --statistics -1 -2 -3 \"$FILE\" \"$FILE.X\" 2>&1 | grep -v old | sed \"s/new\:/\n\n/g\"; printf \"\n\n\" \
; /bin/rm \"$FILE.X\"; read -n 1 -t 120'") &
And it works great. I get to see the diff in color, and full screen. When I'm done admiring the changes I touch the keyboard and the window closes, leaving me ready to keep working inside Eclipse....
Created attachment 192802 [details]
External tool config...
(In reply to comment #8) > How hard would it be to hook into the default external tool config and if the > LPT is installed, add a box next to "Allocate Console" option which causes the > tool to run inside the LPT shell versus the default? Might be easier than what > you had in mind? I'm not sure how hard that would be, but it seems to go into the same direction as bug 242373, which suggests to implement a more fully featured type of IConsole. Changing the Local Terminal launch configuration would probably be less work, but I think we still need some exposed API that would allow us to actually open up the terminal view when a user launches a Local Terminal launch configuration; this depends on bug 185348. Implementation replaced in TM Terminal 4.0 |