Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tm-dev] Terminal plug-in integration

With your example, I was able to get everything working nicely.
My use case is to start GDB in the terminal, inside a console.
All that works great in my branch.
However, I don't have a handle on the Process that I launched (GDB); in your
example, it would be the shell that was started.
I'm going to look deeper at how I could get my hands on that reference.

________________________________________
From: tm-dev-bounces@xxxxxxxxxxx [tm-dev-bounces@xxxxxxxxxxx] on behalf of cdtdoug@xxxxxxxxx [cdtdoug@xxxxxxxxx]
Sent: December 19, 2015 7:33 PM
To: Marc Khouzam; TM project developer discussions
Subject: Re: [tm-dev] Terminal plug-in integration

Take a look at what I've done with org.eclipse.remote.console where I embed the terminal control into the Console View with the necessary glue code.

Having said that, I'm not sure the Console View scales the way we want. It's pretty cumbersome in practice. Elena mentioned she was going to try something different.

But it might work out if you're just opening a single console page.

Sent from my BlackBerry 10 smartphone on the Rogers network.
  Original Message
From: Marc Khouzam
Sent: Saturday, December 19, 2015 6:44 PM
To: TM project developer discussions
Reply To: TM project developer discussions
Subject: Re: [tm-dev] Terminal plug-in integration

Hi,

I'm also integrating the Terminal and starting a process programmatically in it. I got things
to work nicely, but I need a reference to the Process object that got started. Looking at the
code I don't see a way to get that reference.

Any suggestions or is it not possible in the current implementation?

BTW, I'm not using ITerminalService.openConsole but instead am making use of
LauncherDelegateManager.getInstance().getLauncherDelegate(
"org.eclipse.tm.terminal.connector.local.launcher.local", false);

> ideally: Can Terminal be embedded inside other view?

There is an example of embedding the terminal inside a console view in the org.eclipse.remote project.
The class is called TerminalConsole.java and the project is found at:
http://git.eclipse.org/c/ptp/org.eclipse.remote.git/
or cloned from
git clone https://git.eclipse.org/r/ptp/org.eclipse.remote

Thanks

Marc

________________________________________
From: tm-dev-bounces@xxxxxxxxxxx [tm-dev-bounces@xxxxxxxxxxx] on behalf of Stieber, Uwe [Uwe.Stieber@xxxxxxxxxxxxx]
Sent: December 16, 2015 11:34 AM
To: TM project developer discussions
Subject: Re: [tm-dev] Terminal plug-in integration

>…but it ended up in the repository:

Make this “… but it didn’t ended up in the repository:”

Uwe ☺



From: tm-dev-bounces@xxxxxxxxxxx [mailto:tm-dev-bounces@xxxxxxxxxxx] On Behalf Of Stieber, Uwe
Sent: Mittwoch, 16. Dezember 2015 17:32
To: TM project developer discussions
Subject: Re: [tm-dev] Terminal plug-in integration

Hi Michal,

>start process in terminal programmatically (something like "/path/to/php {options}")

I wrote this up once for the purpose of having a little terminal development guide, but it ended up in the repository:


1. How to Open a terminal programmatically (and where to find Property Constants that can be used)
--------------------------------------------------------------------------------------------------

To open a terminal programmatically, use the ITerminalService.openConsole(...) method. The terminal to open is
defined by the passed in properties. The following example opens a new local terminal.

// Define the terminal properties
Map<String, Object> properties = new HashMap<String, Object>();
properties.put(ITerminalsConnectorConstants.PROP_TITLE, "My Local Terminal");
properties.put(ITerminalsConnectorConstants.PROP_ENCODING, "UTF-8");
properties.put(ITerminalsConnectorConstants.PROP_PROCESS_WORKING_DIR, "/tmp");

// Create the done callback object
ITerminalService.Done done = new ITerminalService.Done() {
public void done(IStatus done) {
// Place any post processing here
}
};

// Open the terminal
ITerminalService terminal = TerminalServiceFactory.getService();
if (terminal != null) terminal.openConsole(properties, done);

To learn what properties are available an can be set for a specific terminal type, please look
into the ITerminalConnectorConstants interface.



>add additional environment variables before process will be started

Yes, this is supported. The property to be added to the properties map is ‘ITerminalConnectorConstants.PROP_PROCESS_ENVIRONMENT’.

>ideally: Can Terminal be embedded inside other view?

Well, in fact you can do this. The terminal is provided as embeddable control via the o.e.tm.terminal.control plugin. You will have to write some clue code to instantiate the control, but this use case is a supported one.

Best regards, Uwe ☺



From: tm-dev-bounces@xxxxxxxxxxx<mailto:tm-dev-bounces@xxxxxxxxxxx> [mailto:tm-dev-bounces@xxxxxxxxxxx] On Behalf Of Michal Niewrzal
Sent: Mittwoch, 16. Dezember 2015 17:19
To: tm-dev@xxxxxxxxxxx<mailto:tm-dev@xxxxxxxxxxx>
Subject: [tm-dev] Terminal plug-in integration

Hi All,

In our product (Zend Studio) we are thinking about using Terminal as a part of our tool for command line app called Composer (from PHP world). I was looking into Terminal source code for some knowledge but I decided that it would be easier to ask here for guidance:)

What we need in general:
* start process in terminal programmatically (something like "/path/to/php {options}")
* add additional environment variables before process will be started
* ideally: Can Terminal be embedded inside other view?

What I'm looking for is a small example with starting point or link to some documentation that can help:)

I will be glad for any help. Thanks in advance.
Michal
_______________________________________________
tm-dev mailing list
tm-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tm-dev
_______________________________________________
tm-dev mailing list
tm-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tm-dev

Back to the top