Skip to main content



      Home
Home » Eclipse Projects » DSDP - Target Management » Open a remote shell programmatically
Open a remote shell programmatically [message #17746] Mon, 14 January 2008 07:42 Go to next message
Eclipse UserFriend
Hello,

I have the following question:

I want to execute a command remotely in the default shell of a
connection programmatically, hence I wrote:

IRemoteCmdSubSystem cmdSS =
RemoteCommandHelpers.getCmdSubSystem(connection);
IRemoteCommandShell shell = cmdSS.getDefaultShell();
cmdSS.sendCommandToShell("ls", shell, null);

If the default shell was not open, it is opened, but only shown in the
"Remote Systems" view. I now want to do programmatically exactly what
happens when I choose "Show in Remote Shell View" from the default
shell's context menu, i.e. the "Remote Shell" view shall pop up, and the
default shell shall be visible (i.e. newly opened, or brought to
foreground).

How can I accomplish this?

Thank you + best regards,
Harald Krapfenbauer
Re: Open a remote shell programmatically [message #17751 is a reply to message #17746] Tue, 15 January 2008 05:13 Go to previous messageGo to next message
Eclipse UserFriend
Okay, the best I achieved up to now is the following code:

SystemCommandsViewPart cmdsPart =
SystemCommandsUI.getInstance().activateCommandsView();
if (cmdsPart != null) {
cmdsPart.updateOutput(finalShell); cmdsPart.showPageFor(finalShell);
}

(where finalShell is an IRemoteCommandShell)

This uses RSE-internal classes, and this is not a good way of course.
Bringing the "Remote shells" view to foreground is possible without
activateCommandsView(), but for showing the IRemoteShell in this view I
found nothing in the public API.

Any better solutions welcome!
Harald


Harald Krapfenbauer wrote:
> Hello,
>
> I have the following question:
>
> I want to execute a command remotely in the default shell of a
> connection programmatically, hence I wrote:
>
> IRemoteCmdSubSystem cmdSS =
> RemoteCommandHelpers.getCmdSubSystem(connection);
> IRemoteCommandShell shell = cmdSS.getDefaultShell();
> cmdSS.sendCommandToShell("ls", shell, null);
>
> If the default shell was not open, it is opened, but only shown in the
> "Remote Systems" view. I now want to do programmatically exactly what
> happens when I choose "Show in Remote Shell View" from the default
> shell's context menu, i.e. the "Remote Shell" view shall pop up, and the
> default shell shall be visible (i.e. newly opened, or brought to
> foreground).
>
> How can I accomplish this?
>
> Thank you + best regards,
> Harald Krapfenbauer
Re: Open a remote shell programmatically [message #18441 is a reply to message #17751] Fri, 18 January 2008 13:21 Go to previous message
Eclipse UserFriend
Hi Harld,

Could you open a defect for this? Right now I don't know of a way for you
to avoid using the internal classes since SystemCommandsViewPart is
internal. Perhaps we can make SystemCommandsUI public and provide an
updateOutput() method in there.

Dave

"Harald Krapfenbauer" <krapfenbauer@ict.tuwien.ac.at> wrote in message
news:fmi0vj$in$1@build.eclipse.org...
> Okay, the best I achieved up to now is the following code:
>
> SystemCommandsViewPart cmdsPart =
> SystemCommandsUI.getInstance().activateCommandsView();
> if (cmdsPart != null) {
> cmdsPart.updateOutput(finalShell); cmdsPart.showPageFor(finalShell);
> }
>
> (where finalShell is an IRemoteCommandShell)
>
> This uses RSE-internal classes, and this is not a good way of course.
> Bringing the "Remote shells" view to foreground is possible without
> activateCommandsView(), but for showing the IRemoteShell in this view I
> found nothing in the public API.
>
> Any better solutions welcome!
> Harald
>
>
> Harald Krapfenbauer wrote:
>> Hello,
>>
>> I have the following question:
>>
>> I want to execute a command remotely in the default shell of a connection
>> programmatically, hence I wrote:
>>
>> IRemoteCmdSubSystem cmdSS =
>> RemoteCommandHelpers.getCmdSubSystem(connection);
>> IRemoteCommandShell shell = cmdSS.getDefaultShell();
>> cmdSS.sendCommandToShell("ls", shell, null);
>>
>> If the default shell was not open, it is opened, but only shown in the
>> "Remote Systems" view. I now want to do programmatically exactly what
>> happens when I choose "Show in Remote Shell View" from the default
>> shell's context menu, i.e. the "Remote Shell" view shall pop up, and the
>> default shell shall be visible (i.e. newly opened, or brought to
>> foreground).
>>
>> How can I accomplish this?
>>
>> Thank you + best regards,
>> Harald Krapfenbauer
Re: Open a remote shell programmatically [message #572017 is a reply to message #17746] Tue, 15 January 2008 05:13 Go to previous message
Eclipse UserFriend
Okay, the best I achieved up to now is the following code:

SystemCommandsViewPart cmdsPart =
SystemCommandsUI.getInstance().activateCommandsView();
if (cmdsPart != null) {
cmdsPart.updateOutput(finalShell); cmdsPart.showPageFor(finalShell);
}

(where finalShell is an IRemoteCommandShell)

This uses RSE-internal classes, and this is not a good way of course.
Bringing the "Remote shells" view to foreground is possible without
activateCommandsView(), but for showing the IRemoteShell in this view I
found nothing in the public API.

Any better solutions welcome!
Harald


Harald Krapfenbauer wrote:
> Hello,
>
> I have the following question:
>
> I want to execute a command remotely in the default shell of a
> connection programmatically, hence I wrote:
>
> IRemoteCmdSubSystem cmdSS =
> RemoteCommandHelpers.getCmdSubSystem(connection);
> IRemoteCommandShell shell = cmdSS.getDefaultShell();
> cmdSS.sendCommandToShell("ls", shell, null);
>
> If the default shell was not open, it is opened, but only shown in the
> "Remote Systems" view. I now want to do programmatically exactly what
> happens when I choose "Show in Remote Shell View" from the default
> shell's context menu, i.e. the "Remote Shell" view shall pop up, and the
> default shell shall be visible (i.e. newly opened, or brought to
> foreground).
>
> How can I accomplish this?
>
> Thank you + best regards,
> Harald Krapfenbauer
Re: Open a remote shell programmatically [message #572040 is a reply to message #17751] Fri, 18 January 2008 13:21 Go to previous message
Eclipse UserFriend
Hi Harld,

Could you open a defect for this? Right now I don't know of a way for you
to avoid using the internal classes since SystemCommandsViewPart is
internal. Perhaps we can make SystemCommandsUI public and provide an
updateOutput() method in there.

Dave

"Harald Krapfenbauer" <krapfenbauer@ict.tuwien.ac.at> wrote in message
news:fmi0vj$in$1@build.eclipse.org...
> Okay, the best I achieved up to now is the following code:
>
> SystemCommandsViewPart cmdsPart =
> SystemCommandsUI.getInstance().activateCommandsView();
> if (cmdsPart != null) {
> cmdsPart.updateOutput(finalShell); cmdsPart.showPageFor(finalShell);
> }
>
> (where finalShell is an IRemoteCommandShell)
>
> This uses RSE-internal classes, and this is not a good way of course.
> Bringing the "Remote shells" view to foreground is possible without
> activateCommandsView(), but for showing the IRemoteShell in this view I
> found nothing in the public API.
>
> Any better solutions welcome!
> Harald
>
>
> Harald Krapfenbauer wrote:
>> Hello,
>>
>> I have the following question:
>>
>> I want to execute a command remotely in the default shell of a connection
>> programmatically, hence I wrote:
>>
>> IRemoteCmdSubSystem cmdSS =
>> RemoteCommandHelpers.getCmdSubSystem(connection);
>> IRemoteCommandShell shell = cmdSS.getDefaultShell();
>> cmdSS.sendCommandToShell("ls", shell, null);
>>
>> If the default shell was not open, it is opened, but only shown in the
>> "Remote Systems" view. I now want to do programmatically exactly what
>> happens when I choose "Show in Remote Shell View" from the default
>> shell's context menu, i.e. the "Remote Shell" view shall pop up, and the
>> default shell shall be visible (i.e. newly opened, or brought to
>> foreground).
>>
>> How can I accomplish this?
>>
>> Thank you + best regards,
>> Harald Krapfenbauer
Previous Topic:Open a remote shell programmatically
Next Topic:ssh-only configuration with Plink
Goto Forum:
  


Current Time: Thu Jul 17 13:56:19 EDT 2025

Powered by FUDForum. Page generated in 0.11786 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top